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

Bug 363772

Summary: Checkout of files with filemode changes leave the repository in an inconsistent state.
Product: [Technology] JGit Reporter: Stefan Saasen <ssaasen>
Component: JGitAssignee: Project Inbox <jgit.core-inbox>
Status: CLOSED FIXED QA Contact:
Severity: major    
Priority: P3 CC: markus.duft, matthias.sohn, remy.suen
Version: unspecified   
Target Milestone: 1.3   
Hardware: Macintosh   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:
Attachments:
Description Flags
Script to setup a test repository. none

Description Stefan Saasen CLA 2011-11-15 01:48:36 EST
Build Identifier: 1.1.0.201109151100-r

If there are differences in the executable bit of an entry in the tree, checking out a branch results in an index with staged changes.

The native git client behaves differently, checking out the same branch results in a clean working directory.

Reproducible: Always

Steps to Reproduce:
1. Create a  new git repository (ensure core.filemode is set to true)
2. Create and add a file (use chmod 644)
3. Commit the file addition
4. Set the executable bit (chmod u+x) on that file
5. Commit that change
6. Create a branch pointing to master~1 (i.e. with the changeset without the executable bit set)
7. Use jgit to checkout the new branch

Expected Result: HEAD should point to the new branch, the working directory is clean

Actual Result: HEAD points to the new branch, the working directory is dirty with the filemode change to be commited.
Comment 1 Stefan Saasen CLA 2011-11-15 01:50:25 EST
Created attachment 207005 [details]
Script to setup a test repository.

The attached script can be used to set up a test repository in order to reproduce the behaviour.
Comment 2 Kevin Sawicki CLA 2012-01-03 17:52:18 EST
Proposed fix pushed to: http://egit.eclipse.org/r/#change,4912
Comment 3 Markus Duft CLA 2012-01-11 08:45:48 EST
+1, this is a not-so-cool interop problem with our windows friends :)
Comment 4 Markus Duft CLA 2012-01-11 10:55:38 EST
ah, i was wrong.... this affects all platforms of course. happens on linux the same as on windows.
Comment 5 Markus Duft CLA 2012-01-12 03:29:37 EST
i think this has another side effect: i cannot rebase anymore, as long as i have such a filemode change, and i just get a "rebase failed" message without any further details.!?
Comment 6 Markus Duft CLA 2012-03-16 03:03:54 EDT
can somebody close this, it was fixed by Change-Id: I224602d68228eb419813986807f1eeab77e9c302
Comment 7 Matthias Sohn CLA 2012-04-19 02:35:52 EDT
merged as ed7b322186a872bdd4f41a1a31554a7e90d74de6