stg uncommit should never touch the branch head
authorKarl Hasselström <kha@treskal.com>
Thu, 24 Jul 2008 20:55:05 +0000 (22:55 +0200)
committerKarl Hasselström <kha@treskal.com>
Thu, 24 Jul 2008 20:55:05 +0000 (22:55 +0200)
commit9beaff2e911c0a7c07b288bfdec7597a5cefa7dd
tree0e4afed972ce7361742801d4f5cf974a4c57d51f
parent145fa2143eb508e8c6b36740bd475c23a780cf55
stg uncommit should never touch the branch head

However, currently, it will set head to top, potentially losing data
(which can always be recovered via the reflog, but still). See
https://gna.org/bugs/index.php?12043. Add a test to demonstrate the
bad behavior. (Bug discovered by Erik Sandberg
<mandolaerik@gmail.com>.)

stg commit, on the other hand, should refuse to run if top != head,
since the committed patches might otherwise be lost. Add a test to
demonstrate that this is the case.

Signed-off-by: Karl Hasselström <kha@treskal.com>
t/t1300-uncommit.sh
t/t1303-commit.sh [new file with mode: 0755]