Code

Make git-{pull,rebase} message without tracking information friendlier
[git.git] / t / t3400-rebase.sh
index c3555332366d687d04bfbc031b1be808f3caa802..7788ae02adca18ab1d1f8cf7b76243fbf56377ae 100755 (executable)
@@ -160,14 +160,12 @@ rm -f B
 
 test_expect_success 'fail when upstream arg is missing and not on branch' '
        git checkout topic &&
-       test_must_fail git rebase >output.out &&
-       grep "You are not currently on a branch" output.out
+       test_must_fail git rebase
 '
 
 test_expect_success 'fail when upstream arg is missing and not configured' '
        git checkout -b no-config topic &&
-       test_must_fail git rebase >output.out &&
-       grep "branch.no-config.merge" output.out
+       test_must_fail git rebase
 '
 
 test_expect_success 'default to @{upstream} when upstream arg is missing' '
@@ -218,4 +216,27 @@ test_expect_success 'rebase -m can copy notes' '
        test "a note" = "$(git notes show HEAD)"
 '
 
+test_expect_success 'rebase commit with an ancient timestamp' '
+       git reset --hard &&
+
+       >old.one && git add old.one && test_tick &&
+       git commit --date="@12345 +0400" -m "Old one" &&
+       >old.two && git add old.two && test_tick &&
+       git commit --date="@23456 +0500" -m "Old two" &&
+       >old.three && git add old.three && test_tick &&
+       git commit --date="@34567 +0600" -m "Old three" &&
+
+       git cat-file commit HEAD^^ >actual &&
+       grep "author .* 12345 +0400$" actual &&
+       git cat-file commit HEAD^ >actual &&
+       grep "author .* 23456 +0500$" actual &&
+       git cat-file commit HEAD >actual &&
+       grep "author .* 34567 +0600$" actual &&
+
+       git rebase --onto HEAD^^ HEAD^ &&
+
+       git cat-file commit HEAD >actual &&
+       grep "author .* 34567 +0600$" actual
+'
+
 test_done