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

Can't checkout PR when there are untracked files #1271

Closed
jcansdale opened this Issue Oct 17, 2017 · 0 comments

Comments

Projects
None yet
2 participants
@jcansdale
Copy link
Collaborator

jcansdale commented Oct 17, 2017

  • GitHub Extension for Visual Studio version: 2.3.3.38
  • Visual Studio version: Add

The extension often won't let me checkout PR branches.

image

This can be due to trivial things like build artifacts being added to the staging area.

image

This can be caused by build artifacts/tools (NCrunch) adding files to the working directory. Untracked files usually wouldn't be a problem when using Git from the command line, they can be a real nuisance when using the extension.

This is particularly problematic when the untracked files appear in submodules. The Git command line arguments necessary to clean them up aren't at all obvious (to me at least).

The current check is done here:

public IObservable<bool> IsWorkingDirectoryClean(ILocalRepositoryModel repository)

It uses IsDirty, which checks for any differences between the working directory/index and the last comment. By default, command line Git will allow a checkout if there are untracked files in the working directory.

This issue is even more insidious when an untracked file gets added to a submodule. Here I'ved added foo.txt to the splat submodule.

Visual Studio (below) and the Git command line doesn't give much of a clue as to what's going wrong. You can see that something might be up with the splat submodule, but it doesn't give any indication of exactly what.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.