-
Notifications
You must be signed in to change notification settings - Fork 81
Open
Description
Version
7.0.0
Operating System
Windows
Bug description
- Clone a repository which contains an LFS-managed file with an ampersand character in its file name
- Clone with native git-lfs, not with JGit built-in LFS support
- Here's a minimal reproducible example repo: https://github.com/alxflam-work/egit-clone-lfs.git
- The clone fails on windows, as windows CMD treats ampersand as a special character (command chaining operator)
Actual behavior
- The file name with the ampersand character is passed unescaped to CMD and therefore the native git-lfs smudge command receives not the complete file path (everything after the ampersand is treated as a separate command)
- The command invocation therefore fails with:
org.eclipse.jgit.api.errors.FilterFailedException: Execution of filter command 'git-lfs smudge -- 'some&lfs.txt'' on file 'some&lfs.txt' failed with return code '1', message on stderr: 'Downloading 'some (44 B) 'lfs.txt'' is not recognized as an internal or external command, operable program or batch file. '
Expected behavior
- JGit escapes file names containing & with ^ on windows when invoking the native git-lfs (or potentially other tools)
- For the given example not
some&lfs.txtis passed butsome^&lfs.txt - Clone succeeds
Relevant log output
IOException: org.eclipse.jgit.api.errors.FilterFailedException: Execution of filter command 'git-lfs smudge -- 'some&lfs.txt'' on file 'some&lfs.txt' failed with return code '1', message on stderr: 'Downloading 'some (44 B)
'lfs.txt'' is not recognized as an internal or external command, operable program or batch file
at org.eclipse.jgit.dircache.DirCacheCheckout.runExternalFilterCommand(DirCacheCheckout.java:1549)
at org.eclipse.jgit.dircache.DirCacheCheckout.getContent(DirCacheCheckout.java:1508)
at org.eclipse.jgit.dircache.DirCacheCheckout.getContent(DirCacheCheckout.java:1437)
at org.eclipse.jgit.dircache.Checkout.checkout(Checkout.java:195)
at org.eclipse.jgit.dircache.DirCacheCheckout.doCheckout(DirCacheCheckout.java:577)
at org.eclipse.jgit.dircache.DirCacheCheckout.checkout(DirCacheCheckout.java:480)
at org.eclipse.jgit.api.CloneCommand.checkout(CloneCommand.java:397)
at org.eclipse.jgit.api.CloneCommand.call(CloneCommand.java:216)Other information
- Minimal reproducible example repo: https://github.com/alxflam-work/egit-clone-lfs.git
Metadata
Metadata
Assignees
Labels
No labels