]> asedeno.scripts.mit.edu Git - git.git/blobdiff - t/t0100-previous.sh
Merge branch 'maint'
[git.git] / t / t0100-previous.sh
index db51b421d6dc5370d847ea74433f3df196f225f8..315b9b3f10cfae0186afca6f8024d73cce0a19e2 100755 (executable)
@@ -22,5 +22,28 @@ test_expect_success 'branch -d @{-12} when there is not enough switches yet' '
        git rev-parse --verify refs/heads/master
 '
 
+test_expect_success 'merge @{-1}' '
+       git checkout A &&
+       test_commit B &&
+       git checkout A &&
+       test_commit C &&
+       git branch -f master B &&
+       git branch -f other &&
+       git checkout other &&
+       git checkout master &&
+       git merge @{-1} &&
+       git cat-file commit HEAD | grep "Merge branch '\''other'\''"
+'
+
+test_expect_success 'merge @{-1} when there is not enough switches 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_done