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

Bug 511076

Summary: Checking a file to commit while unresolved conflicts exist anywhere causes an exception
Product: [ECD] Orion Reporter: Remy Suen <remy.suen>
Component: GitAssignee: Remy Suen <remy.suen>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: xinyij
Version: 13.0   
Target Milestone: 14.0   
Hardware: All   
OS: All   
See Also: https://git.eclipse.org/r/89574
https://git.eclipse.org/r/90456
Whiteboard:
Attachments:
Description Flags
Image describing the error in question. none

Description Remy Suen CLA 2017-01-26 04:04:03 EST
1. Create two files test.txt and test2.txt.
2. Create branches A and B that make the content of test.txt diverge in addition to having the changes be on the same line to prevent an auto-resolve.
3. Merge in branch B into A. It won't work and you'll have a conflict.
4. Now modify test2.txt.
5. Open the 'Git' page so you can see your conflicted test.txt and the new change to test2.txt.
6. Check test2.txt.
7. An exception will occur and you'll see a red status message.

Cannot create a tree from a not fully merged index.

8. If you refresh the page, you'll see that the checkbox remains checked otherwise and the change to test2.txt is in the index if you were to check on the CLI.

PUT http://localhost:8081/gitapi/index/file/test2.txt 404 (Cannot create a tree from a not fully merged index.)
_xhr @ xhr.js:175
stage @ gitClient.js:174
(anonymous) @ serviceregistry.js:147
callback @ gitCommands.js:1857
_collectAndInvoke @ commandRegistry.js:451
_invoke @ commandRegistry.js:391
runCommand @ commandRegistry.js:143
(anonymous) @ gitChangeList.js:1283
settleDeferred @ Deferred.js:70
notify @ Deferred.js:144
run @ Deferred.js:28
attributes (async)
(anonymous) @ Deferred.js:46
enqueue @ Deferred.js:58
Deferred.then @ Deferred.js:291
onCheckedFunc @ gitChangeList.js:1269
onCheck @ explorer.js:651
(anonymous) @ explorer.js:632
Comment 1 Eclipse Genie CLA 2017-01-26 04:19:30 EST
New Gerrit change created: https://git.eclipse.org/r/89574
Comment 2 Remy Suen CLA 2017-01-26 04:22:59 EST
If anyone is interested in doing some reading, the libgit2 API clearly states the following:

"The index must not contain any file in conflict."

https://libgit2.github.com/libgit2/#HEAD/group/index/git_index_write_tree
Comment 3 Remy Suen CLA 2017-01-26 04:53:33 EST
Created attachment 266464 [details]
Image describing the error in question.
Comment 5 Eclipse Genie CLA 2017-02-06 15:44:38 EST
New Gerrit change created: https://git.eclipse.org/r/90456
Comment 6 XinYi Jiang CLA 2017-02-07 09:29:19 EST
(In reply to Eclipse Genie from comment #5)
> New Gerrit change created: https://git.eclipse.org/r/90456

A little bit confused here? why the owner of this new patch is me?
Comment 7 Remy Suen CLA 2017-02-07 15:52:34 EST
(In reply to XinYi Jiang from comment #6)
> (In reply to Eclipse Genie from comment #5)
> > New Gerrit change created: https://git.eclipse.org/r/90456
> 
> A little bit confused here? why the owner of this new patch is me?

I have no idea. Maybe an amended commit gone wrong or something.