Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 349225 - [client][git] Unable to stage file deletion
Summary: [client][git] Unable to stage file deletion
Status: RESOLVED FIXED
Alias: None
Product: Orion
Classification: ECD
Component: Client (show other bugs)
Version: 0.2   Edit
Hardware: PC Windows 7
: P3 major (vote)
Target Milestone: 0.2   Edit
Assignee: Tomasz Zarna CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-13 15:40 EDT by John Arthorne CLA
Modified: 2011-09-01 11:42 EDT (History)
2 users (show)

See Also:
Szymon.Brandys: review+


Attachments
Potential fix (1.08 KB, patch)
2011-06-13 15:52 EDT, John Arthorne CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description John Arthorne CLA 2011-06-13 15:40:22 EDT
0.2 RC1

I have an outgoing file deletion, but I cannot stage it from the Git Status page. I get this error message:

Unable to load /gitapi/index/file/e/doc/org.eclipse.orion.doc.isv/WikiDoc/Orion/Server_API/File_API/File-API.html status:500

In the console I can see this JSON error response:

{"Severity":"Error","Message":"Failed to process an operation on index for file/e/doc/org.eclipse.orion.doc.isv/WikiDoc/Orion/Server_API/File_API/File-API.html","HttpCode":500,"Code":0}
Comment 1 John Arthorne CLA 2011-06-13 15:43:27 EDT
By setting a breakpoint on the server I am able to see the underlying exception:

java.util.NoSuchElementException
	at java.util.HashMap$HashIterator.nextEntry(HashMap.java:796)
	at java.util.HashMap$EntryIterator.next(HashMap.java:834)
	at java.util.HashMap$EntryIterator.next(HashMap.java:832)
	at org.eclipse.orion.server.git.servlets.GitIndexHandlerV1.handleRequest(GitIndexHandlerV1.java:61)
	at org.eclipse.orion.server.git.servlets.GitIndexHandlerV1.handleRequest(GitIndexHandlerV1.java:1)
	at org.eclipse.orion.server.git.servlets.GitHandlerV1.handleRequest(GitHandlerV1.java:63)
	at org.eclipse.orion.server.git.servlets.GitHandlerV1.handleRequest(GitHandlerV1.java:1)
	at org.eclipse.orion.server.git.servlets.ServletGitHandler.handleRequest(ServletGitHandler.java:49)
	at org.eclipse.orion.server.git.servlets.ServletGitHandler.handleRequest(ServletGitHandler.java:1)
	at org.eclipse.orion.server.git.servlets.GitServlet.doGet(GitServlet.java:39)
	at org.eclipse.orion.server.git.servlets.GitServlet.doPut(GitServlet.java:52)
Comment 2 John Arthorne CLA 2011-06-13 15:51:30 EDT
The problem is that GitUtils#getGitDirsInParents stops traversing if the file does not exist. However in this case I want to process a deleted file that still has a valid git repository as a parent.
Comment 3 John Arthorne CLA 2011-06-13 15:52:37 EDT
Created attachment 197920 [details]
Potential fix
Comment 4 John Arthorne CLA 2011-06-13 15:53:00 EDT
Please consider for RC2
Comment 5 Simon Kaegi CLA 2011-06-13 16:39:22 EDT
+1 for RC2 - did not review it though.
Comment 6 Tomasz Zarna CLA 2011-06-14 06:53:22 EDT
Thanks for the patch John, I added tests verifying the fix.