remote-hg: the author email can be null
[gitweb.git] / t / t2017-checkout-orphan.sh
index 2d2f63f22ee59d8dc24dafaa5224928ad62dea0c..655f278c5f87926311979732eb6c129a14dd87d3 100755 (executable)
@@ -14,7 +14,7 @@ TEST_FILE=foo
 test_expect_success 'Setup' '
        echo "Initial" >"$TEST_FILE" &&
        git add "$TEST_FILE" &&
-       git commit -m "First Commit"
+       git commit -m "First Commit" &&
        test_tick &&
        echo "State 1" >>"$TEST_FILE" &&
        git add "$TEST_FILE" &&
@@ -116,4 +116,10 @@ test_expect_success '--orphan refuses to switch if a merge is needed' '
        git reset --hard
 '
 
+test_expect_success 'cannot --detach on an unborn branch' '
+       git checkout master &&
+       git checkout --orphan new &&
+       test_must_fail git checkout --detach
+'
+
 test_done