[BUG?] git checkout -b removes MERGE_HEAD

From: Jan Hudec <hidden>
Date: 2016-06-15 22:50:03

Hello all,

I am not sure whether it is a bug or not, but it definitely did
surprise me a lot. The use-case was as follows:

 - I checked out master and ran a merge from branch (let's call
   it "branch"). It had a lot of conflicts, so I needed to test
   the result well.
 - During the testing I found a problem, but it may have already
   existed on master before the merge.
 - Therefore I needed to return to clean master, test it and return
   to the merge. So I thought I'd commit the merge to a temporary
   branch, test master again and merge the temporary to master if
   the problem is not from the merge. So I did:

   $ git checkout -b temp
   $ git commit

   OOPS! It forgot it was a merge.

Yes, I could have simply commited to master and reset --hard it
back. But I didn't expect it to forget it was a merge in the first
place. After all, it does NOT touch the index nor the working tree,
so why should it clear the MERGE_HEAD and MERGE_MSG?

So should this behaviour be changed?

Thanks,
Jan

-- 
                                        - Jan Hudec [off-list ref]
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help