Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 366025

Summary: org.eclipse.jgit.pgm.Main chokes on sh style lines with quoting
Product: [Technology] JGit Reporter: Tomasz Zarna <tomasz.zarna>
Component: JGitAssignee: Project Inbox <jgit.core-inbox>
Status: RESOLVED INVALID QA Contact:
Severity: normal    
Priority: P3 CC: robin.rosenberg, spearce
Version: 1.2   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Tomasz Zarna CLA 2011-12-08 08:03:49 EST
--git-dir D:\temp\clone1\.git commit -m 'first commit'

org.eclipse.jgit.api.errors.JGitInternalException: Entry not found by path: commit'
	at org.eclipse.jgit.api.CommitCommand.createTemporaryIndex(CommitCommand.java:415)
	at org.eclipse.jgit.api.CommitCommand.call(CommitCommand.java:195)
	at org.eclipse.jgit.pgm.Commit.run(Commit.java:87)
	at org.eclipse.jgit.pgm.TextBuiltin.execute(TextBuiltin.java:148)
	at org.eclipse.jgit.pgm.Main.execute(Main.java:191)
	at org.eclipse.jgit.pgm.Main.run(Main.java:120)
	at org.eclipse.jgit.pgm.Main.main(Main.java:94)

See also comments on http://egit.eclipse.org/r/#patch,sidebyside,4720,1,org.eclipse.jgit.test/tst/org/eclipse/jgit/pgm/CLIGitCommand.java
Comment 1 Robin Rosenberg CLA 2011-12-09 07:14:05 EST
Quoting is someting the shell handles. jgit is not a shell so it relies
on the shell that invokes it to parse the argument. CMD.exe does not recognize 
single quotes which is why this fails in cmd, possibly in powershell too, 
but it will work in bash, even on Windows.

JGit should not try to interfere with the shell you are using.