Use rev-parse so gc-checkout recognizes more than just branch names.
[git-central.git] / tests / t5000-script-checkout.sh
index 56fb794..f162189 100644 (file)
@@ -41,5 +41,14 @@ test_expect_success 'checkout an existing local branch' '
        gc-checkout topic1
 '
 
+test_expect_success 'checkout a revision does not create a new branch' '
+       echo "$test_name" >a &&
+       git commit -a -m "$test_name" &&
+
+       prior=$(git rev-parse HEAD^) &&
+       gc-checkout $prior &&
+       git branch | grep "no branch"
+'
+
 test_done