[StGit PATCH 1/2] Test that stg coalesce handles head != top gracefully

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



It currently doesn't quite: it will roll back the transaction just
fine, but not before asking the user for a commit message which is
lost in the rollback.

Bug discovered by Erik Sandberg <mandolaerik@xxxxxxxxx>:
https://gna.org/bugs/?12204

Signed-off-by: Karl Hasselström <kha@xxxxxxxxxxx>

---

 t/t2600-coalesce.sh |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)


diff --git a/t/t2600-coalesce.sh b/t/t2600-coalesce.sh
index ef5bf99..33c073d 100755
--- a/t/t2600-coalesce.sh
+++ b/t/t2600-coalesce.sh
@@ -28,4 +28,17 @@ test_expect_success 'Coalesce at stack top' '
     [ "$(echo $(stg series --unapplied --noprefix))" = "" ]
 '
 
+cat > editor <<EOF
+#!/bin/sh
+echo "Editor was invoked" | tee editor-invoked
+EOF
+chmod a+x editor
+test_expect_failure 'Coalesce with top != head' '
+    echo blahonga >> foo.txt &&
+    git commit -a -m "a new commit" &&
+    EDITOR=./editor command_error stg coalesce --name=r0 p0 q1 &&
+    test "$(echo $(stg series))" = "+ p0 > q1" &&
+    test ! -e editor-invoked
+'
+
 test_done

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux