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

Problem unlinking when checking out individual files #1523

Open
garimasi514 opened this issue Sep 16, 2019 · 2 comments
Open

Problem unlinking when checking out individual files #1523

garimasi514 opened this issue Sep 16, 2019 · 2 comments

Comments

@garimasi514
Copy link

Local Repro

C:\gvfs_repos>gvfs clone https://gvfs.visualstudio.com/ci/_git/ForTests ft
Clone parameters:
Repo URL: https://gvfs.visualstudio.com/ci/_git/ForTests
Branch: Default
Cache Server: Default
Local Cache: C:.gvfsCache
Destination: C:\gvfs_repos\ft
Authenticating...Succeeded
Querying remote for config...Succeeded
Using cache server: None (https://gvfs.visualstudio.com/ci/_git/ForTests)
Cloning...Succeeded
Fetching commits and trees from origin (no cache server)...Succeeded
Validating repo...Succeeded
Mounting...Succeeded
Registering for automount...Succeeded

C:\gvfs_repos>cd ft\src

C:\gvfs_repos\ft\src>git status
On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean

C:\gvfs_repos\ft\src>git checkout origin/FunctionalTests/20180214 -- Readme.md
error: unable to unlink old 'Readme.md': No such file or directory

C:\gvfs_repos\ft\src>type Readme.md >..\test.txt

C:\gvfs_repos\ft\src>git checkout origin/FunctionalTests/20180214 -- Readme.md
error: pathspec 'Readme.md' did not match any file(s) known to git

C:\gvfs_repos\ft\src>git checkout --ignore-skip-worktree-bits origin/FunctionalTests/20180214 -- Readme.md

@garimasi514
Copy link
Author

@kewillford was able to workaround this by reading the file to bring it on disk and then using --ignore-skip-worktree-bits on the checkout as shown in the repro above. @jrbriggs as FYI

@kewillford
Copy link
Member

This command seems to still be doing the correct thing even though the error: message was shown since the file gets updated in the index and status is the same as when the command is ran on a non-VFS for Git repo, so this issue is really that an error is being shown to the user with the git command when it doesn't get shown in a non-VFS for Git repo.

VFS for Git

C:\gvfs_repos\ft\src>git checkout origin/FunctionalTests/20180214 -- Readme.md
error: unable to unlink old 'Readme.md': No such file or directory

C:\gvfs_repos\ft\src>git status
On branch master
Your branch is up to date with 'origin/master'.

Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
        modified:   Readme.md

Not VFS

C:\git_tests>git clone https://gvfs.visualstudio.com/ci/_git/ForTests ft
Cloning into 'ft'...
remote: Azure Repos
remote: Found 3264 objects to send. (30 ms)
Receiving objects: 100% (3264/3264), 1.43 MiB | 5.86 MiB/s, done.
Resolving deltas: 100% (1601/1601), done.

C:\git_tests>cd ft

C:\git_tests\ft>git checkout origin/FunctionalTests/20180214 -- Readme.md

C:\git_tests\ft>git status
On branch master
Your branch is up to date with 'origin/master'.

Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
        modified:   Readme.md

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

No branches or pull requests

2 participants