ericmckean / git-repo

Automatically exported from code.google.com/p/git-repo
Apache License 2.0
0 stars 0 forks source link

repo abandon should fail when there is an unresolved merge #57

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Affected Version:
Environment:

What steps will reproduce the problem?
-1. repo start label <project>
0. work on project, commit changes
1. repo sync <project> fails due to a rebase failure
2. repo abandon label

What is the expected output? What do you see instead?

repo abandon should fail.  When I did that, the branch went away, and then
I realized there was an outstanding rebase, so I went to <project> and did
git rebase --abandon (I didn't care about it).  git failed with the
following error:

git rebase --abort
error: unable to resolve reference refs/heads/<label>: No such file or
directory
fatal: Cannot lock the ref 'refs/heads/<label>'.
Could not move back to refs/heads/<label>

I had to remove manually <project>/.git/rebase-apply to make git forget
about the rebase.

Original issue reported on code.google.com by malc...@gmail.com on 11 Nov 2009 at 11:26

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
I have a slightly easier workaround for anyone (like me) who may have run into 
the same issue.

Once you get the "No such file or directory" error, create a new branch with 
the same name as the abandoned one using:

repo start <label> .

Then, run the abort again:

git rebase --abort

You should now see a new error, something like:

error: Ref refs/heads/<label> is at b300fabbeba06f154a3f026dedd9aef0210755ae 
but expected 74511c2d9b18a40575c7054eb2c0e2e3fecab7c7
fatal: Cannot lock the ref 'refs/heads/<label>'.
Could not move back to refs/heads/<label>

You can clear this by updating the ref:

git update-ref refs/heads/<label> <expected# from the above error>

At this point, you should be able to abort the rebase with one final:
git rebase --abort

Original comment by MMorg76...@gmail.com on 9 May 2011 at 6:38