chiark / gitweb /
Test "stg rebase" after "stg commit"
authorYann Dirson <ydirson@altern.org>
Tue, 12 Jun 2007 21:57:06 +0000 (22:57 +0100)
committerCatalin Marinas <catalin.marinas@gmail.com>
Tue, 12 Jun 2007 21:57:06 +0000 (22:57 +0100)
Two new tests for "stg rebase":

  1. Try to rebase to a commit that is ahead of HEAD. This should
     work, and does.

  2. Try to commit a patch, and then rebase. This doesn't work,
     because "stg rebase" aborts if orig-base != base, and "stg
     commit" doesn't update orig-base. (It does work if "stg rebase"
     is given the --force flag.)

Signed-off-by: Karl Hasselström <kha@treskal.com>
Signed-off-by: Karl Hasselström <kha@treskal.com>
t/t2200-rebase.sh

index c142e08d1934f68b23bb6671a68015012ded4c09..d9b6fafc4e0b713520d00c92efffbf4d522f3a21 100755 (executable)
@@ -43,4 +43,20 @@ test_expect_success \
        test $(stg applied | wc -l) = 1
        '
 
+test_expect_success \
+       'Rebase to next commit' \
+       '
+       stg rebase master &&
+       test $(stg id base@stack) = $(git rev-parse master)
+       '
+
+test_expect_success \
+       'Commit the patch and rebase again' \
+       '
+       stg commit &&
+       git tag committed-here &&
+       stg rebase master &&
+       test $(stg id base@stack) = $(git rev-parse master)
+       '
+
 test_done