Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nbgv prepare-release fails with LibGit2SharpException: could not rmdir #886

Open
HughWarrington opened this issue Jan 12, 2023 · 16 comments

Comments

@HughWarrington
Copy link

HughWarrington commented Jan 12, 2023

I created a test git repo to try out nbgv. I followed these instructions. After running nbgv install I committed the two added files. After this I ran nbgv prepare-release which died with an exception.

From the Developer PowerShell in Visual Studio:

PS C:\Users\hugh\Documents\GitHub\click-once-test\ClickOnceTest> dotnet tool install -g nbgv
You can invoke the tool using the following command: nbgv
Tool 'nbgv' (version '3.5.119') was successfully installed.
PS C:\Users\hugh\Documents\GitHub\click-once-test\ClickOnceTest> nbgv install
PS C:\Users\hugh\Documents\GitHub\click-once-test\ClickOnceTest> nbgv prepare-release
v1.0 branch now tracks v1.0 stabilization and release.
Unhandled exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> LibGit2Sharp.LibGit2SharpException: could not rmdir 'C:/Users/hugh/Documents/GitHub/click-once-test/ClickOnceTest/': The process cannot access the file because it is being used by another process.

   at LibGit2Sharp.Core.Ensure.HandleError(Int32 result) in /_/LibGit2Sharp/Core/Ensure.cs:line 136
   at LibGit2Sharp.Core.Ensure.ZeroResult(Int32 result) in /_/LibGit2Sharp/Core/Ensure.cs:line 173
   at LibGit2Sharp.Core.Proxy.git_checkout_tree(RepositoryHandle repo, ObjectId treeId, GitCheckoutOpts& opts) in /_/LibGit2Sharp/Core/Proxy.cs:line 226
   at LibGit2Sharp.Repository.CheckoutTree(Tree tree, IList`1 paths, IConvertableToGitCheckoutOpts opts) in /_/LibGit2Sharp/Repository.cs:line 956
   at LibGit2Sharp.Repository.Checkout(Tree tree, IEnumerable`1 paths, CheckoutOptions options) in /_/LibGit2Sharp/Repository.cs:line 942
   at LibGit2Sharp.Commands.Checkout(IRepository repository, Tree tree, CheckoutOptions checkoutOptions, String refLogHeadSpec) in /_/LibGit2Sharp/Commands/Checkout.cs:line 152
   at LibGit2Sharp.Commands.Checkout(IRepository repository, Branch branch, CheckoutOptions options) in /_/LibGit2Sharp/Commands/Checkout.cs:line 95
   at LibGit2Sharp.Commands.Checkout(IRepository repository, String committishOrBranchSpec, CheckoutOptions options) in /_/LibGit2Sharp/Commands/Checkout.cs:line 53
   at LibGit2Sharp.Commands.Checkout(IRepository repository, String committishOrBranchSpec) in /_/LibGit2Sharp/Commands/Checkout.cs:line 20
   at Nerdbank.GitVersioning.ReleaseManager.PrepareRelease(String projectDirectory, String releaseUnstableTag, Version nextVersion, Nullable`1 versionIncrement, ReleaseManagerOutputMode outputMode) in D:\a\1\s\src\NerdBank.GitVersioning\ReleaseManager.cs:line 309
   at Nerdbank.GitVersioning.Tool.Program.OnPrepareReleaseCommand(String project, String nextVersion, String versionIncrement, String format, String tag) in D:\a\1\s\src\nbgv\Program.cs:line 716
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Delegate.DynamicInvokeImpl(Object[] args)
   at System.Delegate.DynamicInvoke(Object[] args)
   at System.CommandLine.Invocation.ModelBindingCommandHandler.InvokeAsync(InvocationContext context)
   at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_0.<<BuildInvocationChain>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseParseErrorReporting>b__21_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass16_0.<<UseHelp>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass25_0.<<UseVersionOption>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass23_0.<<UseTypoCorrections>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseSuggestDirective>b__22_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseParseDirective>b__20_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseDebugDirective>b__11_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<RegisterWithDotnetSuggest>b__10_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass14_0.<<UseExceptionHandler>b__0>d.MoveNext()

There is a commit Set version to '1.0' on my master branch, and version.json has been deleted from the working directory.

I am using Visual Studio 2022 17.4.3.

This also happens if I close Visual Studio and run nbgv from a standalone Windows PowerShell console. Which suggests it's not VS with an open handle to the ClickOnceTest dir (why is nbgv trying to remove that dir anyway?).

@AArnott
Copy link
Collaborator

AArnott commented Jan 20, 2023

I have no idea why nbgv prepare-release would ever delete version.json, much less your click-once-test/ClickOnceTest directory. If checking out a different branch led to that, perhaps because this file and directory exists in one branch and not another, then maybe, but that too is really weird because prepare-release creates a branch based on your current one and then switches between them a bit, so they should be nearly identical. If you can provide your exact repro steps, I'll try to repro myself.

@HughWarrington
Copy link
Author

Yeah I also don't know why it's trying to delete my whole repo!

Here are repro steps, although I don't think this adds anything to my original report since it's a very vanilla setup.

  1. Create new git repo.
  2. Add .gitignore and Hello World csproj, commit
**********************************************************************
** Visual Studio 2022 Developer PowerShell v17.4.3
** Copyright (c) 2022 Microsoft Corporation
**********************************************************************
PS C:\Users\hugh\Documents\GitHub\ngbv-bug\ConsoleApp1> dotnet tool install -g nbgv
Tool 'nbgv' is already installed.
PS C:\Users\hugh\Documents\GitHub\ngbv-bug\ConsoleApp1> nbgv install
PS C:\Users\hugh\Documents\GitHub\ngbv-bug\ConsoleApp1> git add -A
PS C:\Users\hugh\Documents\GitHub\ngbv-bug\ConsoleApp1> git commit -m 'Install nbgv'
[v1.0 e90a989] Install nbgv
 2 files changed, 22 insertions(+)
 create mode 100644 Directory.Build.props
 create mode 100644 version.json
PS C:\Users\hugh\Documents\GitHub\ngbv-bug\ConsoleApp1> nbgv prepare-release
v1.0 branch now tracks v1.0 stabilization and release.
Unhandled exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> LibGit2Sharp.LibGit2SharpException: could not rmdir 'C:/Users/hugh/Documents/GitHub/ngbv-bug/ConsoleApp1/': The process cannot access the file because it is being used by another process.

   at LibGit2Sharp.Core.Ensure.HandleError(Int32 result) in /_/LibGit2Sharp/Core/Ensure.cs:line 136
   at LibGit2Sharp.Core.Ensure.ZeroResult(Int32 result) in /_/LibGit2Sharp/Core/Ensure.cs:line 173
   at LibGit2Sharp.Core.Proxy.git_checkout_tree(RepositoryHandle repo, ObjectId treeId, GitCheckoutOpts& opts) in /_/LibGit2Sharp/Core/Proxy.cs:line 226
   at LibGit2Sharp.Repository.CheckoutTree(Tree tree, IList`1 paths, IConvertableToGitCheckoutOpts opts) in /_/LibGit2Sharp/Repository.cs:line 956
   at LibGit2Sharp.Repository.Checkout(Tree tree, IEnumerable`1 paths, CheckoutOptions options) in /_/LibGit2Sharp/Repository.cs:line 942
   at LibGit2Sharp.Commands.Checkout(IRepository repository, Tree tree, CheckoutOptions checkoutOptions, String refLogHeadSpec) in /_/LibGit2Sharp/Commands/Checkout.cs:line 152
   at LibGit2Sharp.Commands.Checkout(IRepository repository, Branch branch, CheckoutOptions options) in /_/LibGit2Sharp/Commands/Checkout.cs:line 95
   at LibGit2Sharp.Commands.Checkout(IRepository repository, String committishOrBranchSpec, CheckoutOptions options) in /_/LibGit2Sharp/Commands/Checkout.cs:line 53
   at LibGit2Sharp.Commands.Checkout(IRepository repository, String committishOrBranchSpec) in /_/LibGit2Sharp/Commands/Checkout.cs:line 20
   at Nerdbank.GitVersioning.ReleaseManager.PrepareRelease(String projectDirectory, String releaseUnstableTag, Version nextVersion, Nullable`1 versionIncrement, ReleaseManagerOutputMode outputMode) in D:\a\1\s\src\NerdBank.GitVersioning\ReleaseManager.cs:line 309
   at Nerdbank.GitVersioning.Tool.Program.OnPrepareReleaseCommand(String project, String nextVersion, String versionIncrement, String format, String tag) in D:\a\1\s\src\nbgv\Program.cs:line 716
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Delegate.DynamicInvokeImpl(Object[] args)
   at System.Delegate.DynamicInvoke(Object[] args)
   at System.CommandLine.Invocation.ModelBindingCommandHandler.InvokeAsync(InvocationContext context)
   at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_0.<<BuildInvocationChain>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseParseErrorReporting>b__21_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass16_0.<<UseHelp>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass25_0.<<UseVersionOption>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass23_0.<<UseTypoCorrections>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseSuggestDirective>b__22_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseParseDirective>b__20_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseDebugDirective>b__11_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<RegisterWithDotnetSuggest>b__10_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass14_0.<<UseExceptionHandler>b__0>d.MoveNext()

@jgilm
Copy link

jgilm commented Jan 27, 2023

I'm having the exact same problem.

  1. Have a branch off main
  2. Made changes to branch, committed them
  3. installed nbgv tool: dotnet tool install -g nbgv
  4. ran nbgv install
  5. committed changes to branch and pushed to origin
  6. ran nbgv prepare-release

Outcome

  • v1.0 branch created
  • unstaged change that has the version.json file deleted
  • Exception raised
❯ nbgv prepare-release
v1.0 branch now tracks v1.0 stabilization and release.
Unhandled exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> LibGit2Sharp.LibGit2SharpException: could not rmdir 'C:/dev/<repo directory>/src/': The process cannot access the file because it is being used by another process.

   at LibGit2Sharp.Core.Ensure.HandleError(Int32 result) in /_/LibGit2Sharp/Core/Ensure.cs:line 136
   at LibGit2Sharp.Core.Ensure.ZeroResult(Int32 result) in /_/LibGit2Sharp/Core/Ensure.cs:line 173
   at LibGit2Sharp.Core.Proxy.git_checkout_tree(RepositoryHandle repo, ObjectId treeId, GitCheckoutOpts& opts) in /_/LibGit2Sharp/Core/Proxy.cs:line 226
   at LibGit2Sharp.Repository.CheckoutTree(Tree tree, IList`1 paths, IConvertableToGitCheckoutOpts opts) in /_/LibGit2Sharp/Repository.cs:line 956
   at LibGit2Sharp.Repository.Checkout(Tree tree, IEnumerable`1 paths, CheckoutOptions options) in /_/LibGit2Sharp/Repository.cs:line 942
   at LibGit2Sharp.Commands.Checkout(IRepository repository, Tree tree, CheckoutOptions checkoutOptions, String refLogHeadSpec) in /_/LibGit2Sharp/Commands/Checkout.cs:line 152
   at LibGit2Sharp.Commands.Checkout(IRepository repository, Branch branch, CheckoutOptions options) in /_/LibGit2Sharp/Commands/Checkout.cs:line 95
   at LibGit2Sharp.Commands.Checkout(IRepository repository, String committishOrBranchSpec, CheckoutOptions options) in /_/LibGit2Sharp/Commands/Checkout.cs:line 53
   at LibGit2Sharp.Commands.Checkout(IRepository repository, String committishOrBranchSpec) in /_/LibGit2Sharp/Commands/Checkout.cs:line 20   at Nerdbank.GitVersioning.ReleaseManager.PrepareRelease(String projectDirectory, String releaseUnstableTag, Version nextVersion, Nullable`1 versionIncrement, ReleaseManagerOutputMode outputMode) in D:\a\1\s\src\NerdBank.GitVersioning\ReleaseManager.cs:line 309
   at Nerdbank.GitVersioning.Tool.Program.OnPrepareReleaseCommand(String project, String nextVersion, String versionIncrement, String format, String tag) in D:\a\1\s\src\nbgv\Program.cs:line 716
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Delegate.DynamicInvokeImpl(Object[] args)
   at System.Delegate.DynamicInvoke(Object[] args)
   at System.CommandLine.Invocation.ModelBindingCommandHandler.InvokeAsync(InvocationContext context)
   at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_0.<<BuildInvocationChain>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseParseErrorReporting>b__21_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass16_0.<<UseHelp>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass25_0.<<UseVersionOption>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass23_0.<<UseTypoCorrections>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseSuggestDirective>b__22_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseParseDirective>b__20_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseDebugDirective>b__11_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<RegisterWithDotnetSuggest>b__10_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass14_0.<<UseExceptionHandler>b__0>d.MoveNext()

@AArnott
Copy link
Collaborator

AArnott commented Jan 28, 2023

I followed your steps and the right thing happened. And we certainly have no code in nbgv to delete any directory. The callstack shows LibGit2Sharp is the one doing it during Checkout. Seems to me then that there must be some serious bug in LibGit2Sharp. Maybe it's misbehaving because the git database is using an unsupported pattern (newer than the libgit2sharp that nbgv ships, perhaps). We are using the latest LibGit2Sharp (0.27.0-preview-0182).

@bording @ethomson any ideas?

@ethomson
Copy link

What's the diff of the commit that is HEAD and the commit that you're checking out?

@HughWarrington
Copy link
Author

@ethomson I'm not sure if your question is aimed at me or @AArnott, but I've had a go at answering it.

I locally checked out what I took to be the relevant revisions of Nerdbank.GitVersioning and LibGit2Sharp, brought them into a VS solution and stepped through a run of ngbv prepare-release in the debugger. I may not have got the Nerdbank.GitVersioning or LibGit2Sharp versions exactly right because (ironically) I can't figure out how the releases of those two repos correspond to git revisions, but I think I'm pretty close to the revisions in which I encountered this problem 'in the wild'.

However, running in the debugger, the command succeeds as expected, so perhaps the info below isn't so useful. Here goes anyway.

Control flow passes into LibGit2Sharp here with repository=C:\Users\hugh\Documents\GitHub\ngbv-bug\ and releaseBranch=refs/heads/v1.0 => "82ea0f7".

Then I follow the stack trace as in my original comment above, as far as LibGit2Sharp.Core.Proxy.git_checkout_tree. In the debugger tree.Id={d7976f1cc41a736a49cb41a31c6369fa3e8efda9}. options looks equivalent to new GitCheckoutOpts() { checkout_strategy=CheckoutStrategy.GIT_CHECKOUT_SAFE, version=1 }.

So to try and directly answer your question @ethomson:

C:\Users\hugh\Documents\GitHub\ngbv-bug>type .git\HEAD
ref: refs/heads/master

# Taking the tree.Id from above

C:\Users\hugh\Documents\GitHub\ngbv-bug>git cat-file -t d7976f1cc41a736a49cb41a31c6369fa3e8efda9
tree

C:\Users\hugh\Documents\GitHub\ngbv-bug>git cat-file -p d7976f1cc41a736a49cb41a31c6369fa3e8efda9
100644 blob dfe0770424b2a19faf507a501ebfc23be8f54e7b    .gitattributes
100644 blob 8dd4607a4b3c4f581d2728ef1cd2d15ad42e2ee2    .gitignore
040000 tree cf2b7b94e93778638a285886f596bce83e92521d    ConsoleApp1
100644 blob 84068b4189fb0258e3a2f1a5a4d497b730341f75    Directory.Build.props
100644 blob 96d924a4535a5b13a3d3a82898a32833c4786825    version.json

I don't know enough about git internals, but to me this looks like a commit waiting to happen, presumably containing the modifications to those files that nbgv makes when making the new v1.0 release.

@AArnott
Copy link
Collaborator

AArnott commented Feb 7, 2023

@HughWarrington I think what @ethomson was asking for was just a git diff HEAD..other printout, where 'other' is the commit that's being checked out.
@ethomson, nbgv prepare-release only moves HEAD to a commit it authored based on HEAD, which only changes a file or two. Nothing to warrant deleting a directory, much less the repo root directory itself.

@HughWarrington You can find the exact commit that is behind your nbgv tool by running nbgv --version, like this:

❯ nbgv --version
3.5.119+5d25f54fec

This tells you that my nbgv tool was built from the commit beginning with hash 5d25f54.
Look for the version of libgit2sharp that that nbgv uses from its source code, then jump here and click on the version of the package that matches.
Then hover over the "License Info" link and note the URL, which includes the git commit from which that particular version was built from:

image

@ethomson
Copy link

ethomson commented Feb 7, 2023

@ethomson, nbgv prepare-release only moves HEAD to a commit it authored based on HEAD, which only changes a file or two. Nothing to warrant deleting a directory, much less the repo root directory itself.

That's useful to know. It would be interesting to see what the diff shows and if it shows only those two files, or if there's a subtle difference between the commits. Is there a difference in case? Unicode encoding? etc. Or if it's just a file or two.

@HughWarrington
Copy link
Author

Thanks for all the info @AArnott. I am also using Nerdbank.GitVersioning 3.5.119+5d25f54fec. This depends on LibGit2Sharp 0.27.0-preview-0158 but your neat trick with the License Info path doesn't seem to work. 0.27.0-preview-0158 does not correspond to any release, branch, or tag that I can find in https://github.com/libgit2/libgit2sharp.

@AArnott
Copy link
Collaborator

AArnott commented Feb 7, 2023

@HughWarrington Interesting. I downloaded the package version you mentioned, pulled out the dll, then opened the dll in ILSpy. I found this:
[assembly: AssemblyInformationalVersion("0.27.0-preview.158+abdd8fbf65.libgit2-b7bad55")]
I believe that means this is the version of code that matches.

@AArnott
Copy link
Collaborator

AArnott commented Feb 7, 2023

@ethomson I think all the libgit2sharp calls around creating commits, branches, and staging changes is here:

// create release branch and update version
Branch releaseBranch = repository.CreateBranch(releaseBranchName);
global::LibGit2Sharp.Commands.Checkout(repository, releaseBranch);
this.UpdateVersion(context, versionOptions.Version, releaseVersion);
if (outputMode == ReleaseManagerOutputMode.Text)
{
this.stdout.WriteLine($"{releaseBranchName} branch now tracks v{releaseVersion} stabilization and release.");
}
// update version on main branch
global::LibGit2Sharp.Commands.Checkout(repository, originalBranchName);

We:

  1. Create a branch based on HEAD, and checkout that branch
  2. We change version.json, stage it and commit.
  3. Checkout the original branch
  4. Change version.json, stage it and commit again with the same code as step 2.

So literally, the only change we're making is to an existing file, and checkout is across branches that only varies by that one file.

@ethomson
Copy link

ethomson commented Feb 7, 2023

So literally, the only change we're making is to an existing file, and checkout is across branches that only varies by that one file.

I'm not suggesting that you're doing something wrong. There's a lot of things happening in a lot of layers.

@AArnott
Copy link
Collaborator

AArnott commented Feb 7, 2023

Understood. I wasn't meaning to sound defensive. I really appreciate your review of this issue. I just wanted to clearly answer your question about impact from checkout, case changes, etc, that you asked about.

@ethomson
Copy link

ethomson commented Feb 7, 2023

No, no worries. I was just trying to make sure that I was clear that ... I have no idea what's going on or why yet. 😁 All I really know so far is that I agree that this seems like very unexpected behavior and I'm pretty stumped.

@vErsateX
Copy link

I was having the same issue, and I noticed that it specifically occurred when I ran nbgv prepare-release in a sub-directory; running it in the repository root seemed to complete without error. All of the cases reported here seem to be doing the same, either running it in the solution directory or in a src directory.

Also relevant here is that the Visual Studio Developer PowerShell of course starts in the solution folder, meaning running it from there will fail by default, which probably adds to the confusion.

@AArnott
Copy link
Collaborator

AArnott commented Apr 26, 2023

Thanks for sharing. Maybe @ethomson can use that in figuring out why libgit2 would be doing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants