scalar: teach 'clone' to support the --single-branch option

Just like `git clone`, the `scalar clone` command now also offers to
restrict the clone to a single branch.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Johannes Schindelin
2021-12-03 13:34:24 +00:00
committed by Junio C Hamano
parent 546f822d53
commit 4368e40bef
3 changed files with 23 additions and 4 deletions

View File

@ -45,13 +45,17 @@ test_expect_success 'set up repository to clone' '
test_expect_success 'scalar clone' '
second=$(git rev-parse --verify second:second.t) &&
scalar clone "file://$(pwd)" cloned &&
scalar clone "file://$(pwd)" cloned --single-branch &&
(
cd cloned/src &&
git config --get --global --fixed-value maintenance.repo \
"$(pwd)" &&
git for-each-ref --format="%(refname)" refs/remotes/origin/ >actual &&
echo "refs/remotes/origin/parallel" >expect &&
test_cmp expect actual &&
test_path_is_missing 1/2 &&
test_must_fail git rev-list --missing=print $second &&
git rev-list $second &&