Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 344975 - org.eclipse.jgit.pgm.Diff gives strange result
Summary: org.eclipse.jgit.pgm.Diff gives strange result
Status: VERIFIED FIXED
Alias: None
Product: JGit
Classification: Technology
Component: JGit (show other bugs)
Version: 0.12   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 1.0.0   Edit
Assignee: Robin Rosenberg CLA
QA Contact:
URL: http://egit.eclipse.org/r/#change,3356
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-06 10:37 EDT by Tomasz Zarna CLA
Modified: 2011-05-16 05:25 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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!