larsks · GitHub

Some time earlier in the week, I made a temporary clone of an stgit managed branch:

stg branch --clone work

I ended up switching back to the primary branch and deleting the old one:

git checkout devel
git branch -D work

Just now, I tried creating a stgit clone with the same name:

stg branch --clone work

And that failed because of artifacts left over from the previous branch:

error: Reference "refs/stacks/work" was not supposed to exist when writing it with value Peeled(Sha1(b9001282cc467a07123c65d4eea0b00892859913)), but actual content was Peeled(Sha1(635221571b89fe943b2532c5dfecb18a72a7a5a0))
  1. Is stgit expected to fail in this situation? Should it just replace the target reference, since the associated branch no longer exists? Should it by default not replace it, but offer a --force option or similar to make it work?

  2. If it's expected to fail, maybe we could make that error message a little more user friendly? I was trying to think of appropriate phrasing, but I think the answers to the first question will provide some guidance for what it should say.

Read the original on github.com ↗