Re: [PATCH v2] clone: Allow combining --bare and --origin
From: Junio C Hamano <hidden>
Date: 2021-08-04 01:16:53
Øystein Walle [off-list ref] writes:
quoted hunk
diff --git a/t/t5606-clone-options.sh b/t/t5606-clone-options.sh index 3a595c0f82..c40dde816d 100755 --- a/t/t5606-clone-options.sh +++ b/t/t5606-clone-options.sh@@ -30,12 +30,12 @@ test_expect_success 'rejects invalid -o/--origin' ' ' -test_expect_success 'disallows --bare with --origin' ' - - test_must_fail git clone -o foo --bare parent clone-bare-o 2>err && - test_debug "cat err" && - test_i18ngrep -e "--bare and --origin foo options are incompatible" err +test_expect_success '--bare works with -o/--origin' ' + git clone --bare --origin=somewhere parent clone-bare && + url="$(git -C clone-bare config --local remote.somewhere.url)" && + test -n "$url" && + test_must_fail git -C clone-bare config --local remote.origin.url '
This breaks a later step that creates clone-bare as this used to use clone-bare-o and the name was available. Using clone-bare-o as it used to would probably be the easiest fix.
test_expect_success 'disallows --bare with --separate-git-dir' '