]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t3420-rebase-autostash.sh
Merge branch 'js/doc-patch-text'
[thirdparty/git.git] / t / t3420-rebase-autostash.sh
index b8f4d034672378065a5fe08df6b8210fa3c71721..5f7e73cf83a267cd3dc74917c963352fe9a1856d 100755 (executable)
@@ -37,7 +37,6 @@ test_expect_success setup '
 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
@@ -48,7 +47,6 @@ create_expected_success_am () {
 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
@@ -57,7 +55,6 @@ create_expected_success_interactive () {
 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
@@ -70,7 +67,6 @@ create_expected_failure_am () {
 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.
@@ -306,4 +302,12 @@ 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