Merge branch 'bc/fetch-pack-clear-alternate-shallow'
[gitweb.git] / t / t2018-checkout-branch.sh
index 2131fb2a5682c50faf64e6066f03080702168b94..c5014ad9a63f2451f84db5076f902a0132d318c1 100755 (executable)
@@ -198,4 +198,13 @@ test_expect_success 'checkout -B to the current branch works' '
        test_dirty_mergeable
 '
 
+test_expect_success 'checkout -b after clone --no-checkout does a checkout of HEAD' '
+       git init src &&
+       test_commit -C src a &&
+       rev="$(git -C src rev-parse HEAD)" &&
+       git clone --no-checkout src dest &&
+       git -C dest checkout "$rev" -b branch &&
+       test_path_is_file dest/a.t
+'
+
 test_done