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

Bug 361570

Summary: DiffEntry.scan() does not report executable bit only difference
Product: [Technology] JGit Reporter: Stanley Chen <stanzchen>
Component: JGitAssignee: Project Inbox <jgit.core-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: artur, matthew, remy.suen, robin.rosenberg, stanzchen
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: Linux   
Whiteboard:

Description Stanley Chen CLA 2011-10-20 11:39:50 EDT
Build Identifier: jgit 1.2.0

Currently scan() will determine if a file is missing on either side of the diff but will only check for content changes:


 else if {!entry.oldId.equals(entry.newId) {
	entry.changeType = ChangeType.MODIFY;
	if (RenameDetector.sameType(entry.oldMode, entry.newMode))
 	        r.add(entry);
	else
		r.addAll(breakModify(entry));
}

This prevents changes in file permissions from being returned in the diff list.

Reproducible: Always

Steps to Reproduce:
1.Create a commit with a new file
2.chmod +x the file and commit again
3.jgit diff the two commits, nothing is reported
4.do the same with git diff and differences in permissions are reported
Comment 1 Matthew Webber CLA 2011-12-07 11:50:28 EST
A bug has also been opened with the result of this bug as seen by the user:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=345076
Can't commit file with only file permission change.
Comment 2 Kevin Sawicki CLA 2011-12-14 20:31:37 EST
Proposed fix pushed to http://egit.eclipse.org/r/#change,4826
Comment 3 Robin Rosenberg CLA 2011-12-16 10:26:24 EST
(In reply to comment #1)
> A bug has also been opened with the result of this bug as seen by the user:
> 
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=345076
> Can't commit file with only file permission change.

Actually it's a different code path for that bug.
Comment 4 Robin Rosenberg CLA 2011-12-16 10:31:09 EST
78bc526d9b7e5063d267a76b0bbefaa989139bf3 merged