rebase: invoke post-rewrite hook
[gitweb.git] / t / t5407-post-rewrite-hook.sh
index 1020af94b714635d94e6f014889af004353fe0dd..1ecaa4b580b2049a12fdc4ba80600bfbc802122f 100755 (executable)
@@ -49,4 +49,34 @@ test_expect_success 'git commit --amend --no-post-rewrite' '
        test ! -f post-rewrite.data
 '
 
+test_expect_success 'git rebase' '
+       git reset --hard D &&
+       clear_hook_input &&
+       test_must_fail git rebase --onto A B &&
+       echo C > foo &&
+       git add foo &&
+       git rebase --continue &&
+       echo rebase >expected.args &&
+       cat >expected.data <<EOF &&
+$(git rev-parse C) $(git rev-parse HEAD^)
+$(git rev-parse D) $(git rev-parse HEAD)
+EOF
+       verify_hook_input
+'
+
+test_expect_success 'git rebase --skip' '
+       git reset --hard D &&
+       clear_hook_input &&
+       test_must_fail git rebase --onto A B &&
+       test_must_fail git rebase --skip &&
+       echo D > foo &&
+       git add foo &&
+       git rebase --continue &&
+       echo rebase >expected.args &&
+       cat >expected.data <<EOF &&
+$(git rev-parse D) $(git rev-parse HEAD)
+EOF
+       verify_hook_input
+'
+
 test_done