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

Bug 348524

Summary: Resetting to a ref with a folder path fails
Product: [Technology] JGit Reporter: Tomasz Zarna <tomasz.zarna>
Component: JGitAssignee: Dariusz Luksza <dariusz.luksza>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P3 CC: caniszczyk, simon_kaegi, spearce, Szymon.Brandys
Version: 1.0   
Target Milestone: 1.1-M1   
Hardware: PC   
OS: Windows XP   
URL: http://egit.eclipse.org/r/#change,3713
Whiteboard:
Bug Depends on:    
Bug Blocks: 347776    
Attachments:
Description Flags
mylyn/context/zip none

Description Tomasz Zarna CLA 2011-06-07 05:26:17 EDT
Using latest source from JGit repo

Steps:
1. Create a repository with folder and file in it (eg. "folder/file.txt")
2. Add and commit
3. Modify the file inside the folder
4. Add it to index
5. Try to reset it to HEAD using "folder/file.txt" path
=> SHOULD BE: the file should be removed from the index
=> IS: An exception is thrown, "Invalid mode 40000 for path folder"

From Orion point of view this is a blocker, see bug 347776.
Comment 1 Tomasz Zarna CLA 2011-06-07 05:35:26 EDT
(In reply to comment #0)
> Steps:
> 1. Create a repository with folder and file in it (eg. "folder/file.txt")
> 2. Add and commit
> 3. Modify the file inside the folder
> 4. Add it to index
> 5. Try to reset it to HEAD using "folder/file.txt" path
> => SHOULD BE: the file should be removed from the index
> => IS: An exception is thrown, "Invalid mode 40000 for path folder"

Same steps in a form of a failing unit test: http://egit.eclipse.org/r/3666
Comment 2 Tomasz Zarna CLA 2011-06-07 05:36:28 EDT
For another issue with ResetCommand see bug 347856.
Comment 3 Tomasz Zarna CLA 2011-06-07 05:37:44 EDT
Created attachment 197486 [details]
mylyn/context/zip
Comment 4 Tomasz Zarna CLA 2011-06-14 11:47:15 EDT
The patch proposed in Patch Set 2 on http://egit.eclipse.org/r/#change,3666 also fixes bug 347856, the test case attached there passes.
Comment 5 Szymon Brandys CLA 2011-06-15 10:51:10 EDT
(In reply to comment #4)
> The patch proposed in Patch Set 2 on http://egit.eclipse.org/r/#change,3666
> also fixes bug 347856, the test case attached there passes.

There is a patch waiting for review that could fix two bugs at once. Could anyone from the JGit team release it or provide comments how to improve it. Thanks.
Comment 6 Szymon Brandys CLA 2011-06-20 06:04:14 EDT
We need to properly target bug 347776. So far it is Orion 0.3 which I guess is in two months or so. I wonder if the JGit bug is fixed by then.
Comment 7 Chris Aniszczyk CLA 2011-07-12 12:20:22 EDT
Fixed in master, thanks Dariusz and Tomasz.
Comment 8 Tomasz Zarna CLA 2011-07-13 06:52:06 EDT
*** Bug 347856 has been marked as a duplicate of this bug. ***