stgit.el: Honor stgit-find-copies-harder in stgit-diff-range
[stgit] / t / t3103-undo-hard.sh
index 599aa43..b94543e 100755 (executable)
@@ -13,7 +13,7 @@ EOF
 test_expect_success 'Initialize StGit stack with three patches' '
     stg init &&
     echo 000 >> a &&
-    git add a &&
+    stg add a &&
     git commit -m a &&
     echo 111 >> a &&
     git commit -a -m p1 &&
@@ -21,24 +21,27 @@ test_expect_success 'Initialize StGit stack with three patches' '
     git commit -a -m p2 &&
     echo 333 >> a &&
     git commit -a -m p3 &&
-    stg uncommit -n 3
+    stg uncommit -n 3 &&
+    test "$(stg id)" = "$(stg id $(stg top))"
 '
 
 cat > expected.txt <<EOF
 C a
 EOF
 test_expect_success 'Pop middle patch, creating a conflict' '
-    conflict_old stg pop p2 &&
+    conflict stg pop p2 &&
     stg status a > actual.txt &&
     test_cmp expected.txt actual.txt &&
-    test "$(echo $(stg series))" = "+ p1 > p3 - p2"
+    test "$(echo $(stg series))" = "+ p1 > p3 - p2" &&
+    test "$(stg id)" = "$(stg id $(stg top))"
 '
 
 test_expect_success 'Try to undo without --hard' '
     command_error stg undo &&
     stg status a > actual.txt &&
     test_cmp expected.txt actual.txt &&
-    test "$(echo $(stg series))" = "+ p1 > p3 - p2"
+    test "$(echo $(stg series))" = "+ p1 > p3 - p2" &&
+    test "$(stg id)" = "$(stg id $(stg top))"
 '
 
 cat > expected.txt <<EOF
@@ -47,7 +50,8 @@ test_expect_success 'Try to undo with --hard' '
     stg undo --hard &&
     stg status a > actual.txt &&
     test_cmp expected.txt actual.txt &&
-    test "$(echo $(stg series))" = "> p1 - p3 - p2"
+    test "$(echo $(stg series))" = "+ p1 + p2 > p3" &&
+    test "$(stg id)" = "$(stg id $(stg top))"
 '
 
 test_done