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

Bug 344975

Summary: org.eclipse.jgit.pgm.Diff gives strange result
Product: [Technology] JGit Reporter: Tomasz Zarna <tomasz.zarna>
Component: JGitAssignee: Robin Rosenberg <robin.rosenberg>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: caniszczyk, robin.rosenberg, sop
Version: 0.12   
Target Milestone: 1.0.0   
Hardware: PC   
OS: Windows XP   
URL: http://egit.eclipse.org/r/#change,3356
Whiteboard:

Description Tomasz Zarna CLA 2011-05-06 10:37:25 EDT
I have a file under "folder" directory, which in working tree has content "folder change". The latest revision in HEAD content is: "folder". When I ran org.eclipse.jgit.pgm.Main with args: '--git-dir <path to my repo> diff -- folder' I got:

diff --git a/folder/folder.txt b/folder/folder.txt
index 0119635..95c4c65 100644
--- a/folder/folder.txt
+++ b/folder/folder.txt
@@ -1 +1 @@
 folder
\ No newline at end of file

which is definitely not what I would expect. I will submit a failing test case to gerrit in a minute.
Comment 1 Tomasz Zarna CLA 2011-05-06 10:46:03 EDT
Here it is: http://egit.eclipse.org/r/#change,3356

Sorry for messing around with code in org.eclipse.jgit.pgm. All those changes are just to illustrate the issue.
Comment 2 Robin Rosenberg CLA 2011-05-15 10:45:19 EDT
Patch posted. Please do some monkey testing on it.
Comment 3 Shawn Pearce CLA 2011-05-15 15:18:37 EDT
Submitted commit 51a5cc7f1a1033664ee2fb760ed217b665b12b34
Comment 4 Tomasz Zarna CLA 2011-05-16 05:25:15 EDT
(In reply to comment #2)
> Patch posted. Please do some monkey testing on it.

Verified in master -- works fine for cases I'm aware of. Thx!