about summary refs log tree commit diff
path: root/third_party/git/t/t3420-rebase-autostash.sh
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/git/t/t3420-rebase-autostash.sh')
-rwxr-xr-xthird_party/git/t/t3420-rebase-autostash.sh34
1 files changed, 15 insertions, 19 deletions
diff --git a/third_party/git/t/t3420-rebase-autostash.sh b/third_party/git/t/t3420-rebase-autostash.sh
index b97ea62363..b8f4d03467 100755
--- a/third_party/git/t/t3420-rebase-autostash.sh
+++ b/third_party/git/t/t3420-rebase-autostash.sh
@@ -34,9 +34,10 @@ test_expect_success setup '
 	remove_progress_re="$(printf "s/.*\\r//")"
 '
 
-create_expected_success_apply () {
+create_expected_success_am () {
 	cat >expected <<-EOF
 	$(grep "^Created autostash: [0-9a-f][0-9a-f]*\$" actual)
+	HEAD is now at $(git rev-parse --short feature-branch) third commit
 	First, rewinding head to replay your work on top of it...
 	Applying: second commit
 	Applying: third commit
@@ -44,17 +45,19 @@ create_expected_success_apply () {
 	EOF
 }
 
-create_expected_success_merge () {
+create_expected_success_interactive () {
 	q_to_cr >expected <<-EOF
 	$(grep "^Created autostash: [0-9a-f][0-9a-f]*\$" actual)
+	HEAD is now at $(git rev-parse --short feature-branch) third commit
 	Applied autostash.
 	Successfully rebased and updated refs/heads/rebased-feature-branch.
 	EOF
 }
 
-create_expected_failure_apply () {
+create_expected_failure_am () {
 	cat >expected <<-EOF
 	$(grep "^Created autostash: [0-9a-f][0-9a-f]*\$" actual)
+	HEAD is now at $(git rev-parse --short feature-branch) third commit
 	First, rewinding head to replay your work on top of it...
 	Applying: second commit
 	Applying: third commit
@@ -64,9 +67,10 @@ create_expected_failure_apply () {
 	EOF
 }
 
-create_expected_failure_merge () {
+create_expected_failure_interactive () {
 	cat >expected <<-EOF
 	$(grep "^Created autostash: [0-9a-f][0-9a-f]*\$" actual)
+	HEAD is now at $(git rev-parse --short feature-branch) third commit
 	Applying autostash resulted in conflicts.
 	Your changes are safe in the stash.
 	You can run "git stash pop" or "git stash drop" at any time.
@@ -101,9 +105,9 @@ testrebase () {
 
 	test_expect_success "rebase$type --autostash: check output" '
 		test_when_finished git branch -D rebased-feature-branch &&
-		suffix=${type#\ --} && suffix=${suffix:-apply} &&
-		if test ${suffix} = "interactive"; then
-			suffix=merge
+		suffix=${type#\ --} && suffix=${suffix:-am} &&
+		if test ${suffix} = "merge"; then
+			suffix=interactive
 		fi &&
 		create_expected_success_$suffix &&
 		sed "$remove_progress_re" <actual >actual2 &&
@@ -202,9 +206,9 @@ testrebase () {
 
 	test_expect_success "rebase$type: check output with conflicting stash" '
 		test_when_finished git branch -D rebased-feature-branch &&
-		suffix=${type#\ --} && suffix=${suffix:-apply} &&
-		if test ${suffix} = "interactive"; then
-			suffix=merge
+		suffix=${type#\ --} && suffix=${suffix:-am} &&
+		if test ${suffix} = "merge"; then
+			suffix=interactive
 		fi &&
 		create_expected_failure_$suffix &&
 		sed "$remove_progress_re" <actual >actual2 &&
@@ -234,7 +238,7 @@ test_expect_success "rebase: noop rebase" '
 	git checkout feature-branch
 '
 
-testrebase " --apply" .git/rebase-apply
+testrebase "" .git/rebase-apply
 testrebase " --merge" .git/rebase-merge
 testrebase " --interactive" .git/rebase-merge
 
@@ -302,12 +306,4 @@ test_expect_success 'branch is left alone when possible' '
 	test unchanged-branch = "$(git rev-parse --abbrev-ref HEAD)"
 '
 
-test_expect_success 'never change active branch' '
-	git checkout -b not-the-feature-branch unrelated-onto-branch &&
-	test_when_finished "git reset --hard && git checkout master" &&
-	echo changed >file0 &&
-	git rebase --autostash not-the-feature-branch feature-branch &&
-	test_cmp_rev not-the-feature-branch unrelated-onto-branch
-'
-
 test_done