Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 361570 - DiffEntry.scan() does not report executable bit only difference
Summary: DiffEntry.scan() does not report executable bit only difference
Status: RESOLVED FIXED
Alias: None
Product: JGit
Classification: Technology
Component: JGit (show other bugs)
Version: unspecified   Edit
Hardware: All Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-20 11:39 EDT by Stanley Chen CLA
Modified: 2011-12-16 10:31 EST (History)
5 users (show)

See Also:


Attachments

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