]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t0100-previous.sh
strbuf_branchname(): do not double-expand @{-1}~22
[thirdparty/git.git] / t / t0100-previous.sh
index 315b9b3f10cfae0186afca6f8024d73cce0a19e2..e0a69402324fed3c2fd7ca9495f5735742766108 100755 (executable)
@@ -27,6 +27,7 @@ test_expect_success 'merge @{-1}' '
        test_commit B &&
        git checkout A &&
        test_commit C &&
+       test_commit D &&
        git branch -f master B &&
        git branch -f other &&
        git checkout other &&
@@ -35,14 +36,24 @@ test_expect_success 'merge @{-1}' '
        git cat-file commit HEAD | grep "Merge branch '\''other'\''"
 '
 
-test_expect_success 'merge @{-1} when there is not enough switches yet' '
+test_expect_success 'merge @{-1}~1' '
+       git checkout master &&
+       git reset --hard B &&
+       git checkout other &&
+       git checkout master &&
+       git merge @{-1}~1 &&
+       git cat-file commit HEAD >actual &&
+       grep "Merge branch '\''other'\''" actual
+'
+
+test_expect_success 'merge @{-100} before checking out that many branches yet' '
        git reflog expire --expire=now &&
        git checkout -f master &&
        git reset --hard B &&
        git branch -f other C &&
        git checkout other &&
        git checkout master &&
-       test_must_fail git merge @{-12}
+       test_must_fail git merge @{-100}
 '
 
 test_done