Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2019-03-03 20:11:54 +0300
committerJunio C Hamano <gitster@pobox.com>2019-03-04 07:31:04 +0300
commitc2d96293602bf6e8ffa1002cff8cb6faa3854815 (patch)
treed0393b6cb89cdaf192cd697ffa435e02c8a6c04e /t/t3400-rebase.sh
parenteaf81605b8d17cc15a4a72ffd99d71111b70815b (diff)
built-in rebase: demonstrate that ORIG_HEAD is not set correctly
The ORIG_HEAD pseudo ref is supposed to refer to the original, pre-rebase state after a successful rebase. Let's add a regression test to prove that this regressed: With GIT_TEST_REBASE_USE_BUILTIN=false, this test case passes, with GIT_TEST_REBASE_USE_BUILTIN=true (or unset), it fails. Reported by Nazri Ramliy. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t3400-rebase.sh')
-rwxr-xr-xt/t3400-rebase.sh8
1 files changed, 8 insertions, 0 deletions
diff --git a/t/t3400-rebase.sh b/t/t3400-rebase.sh
index 3e73f7584c..7e8d5bb200 100755
--- a/t/t3400-rebase.sh
+++ b/t/t3400-rebase.sh
@@ -59,6 +59,14 @@ test_expect_success 'rebase against master' '
git rebase master
'
+test_expect_failure 'rebase sets ORIG_HEAD to pre-rebase state' '
+ git checkout -b orig-head topic &&
+ pre="$(git rev-parse --verify HEAD)" &&
+ git rebase master &&
+ test_cmp_rev "$pre" ORIG_HEAD &&
+ ! test_cmp_rev "$pre" HEAD
+'
+
test_expect_success 'rebase, with <onto> and <upstream> specified as :/quuxery' '
test_when_finished "git branch -D torebase" &&
git checkout -b torebase my-topic-branch^ &&