diff --git a/builtin/clone.c b/builtin/clone.c index 9e0b2b45ca..f5f902cce1 100644 --- a/builtin/clone.c +++ b/builtin/clone.c @@ -924,9 +924,6 @@ int cmd_clone(int argc, const char **argv, const char *prefix) option_bare = 1; if (option_bare) { - if (option_origin) - die(_("options '%s' and '%s %s' cannot be used together"), - "--bare", "--origin", option_origin); if (real_git_dir) die(_("options '%s' and '%s' cannot be used together"), "--bare", "--separate-git-dir"); option_no_checkout = 1; diff --git a/t/t5606-clone-options.sh b/t/t5606-clone-options.sh index 8f676d6b0c..0000c9f17f 100755 --- a/t/t5606-clone-options.sh +++ b/t/t5606-clone-options.sh @@ -42,11 +42,12 @@ test_expect_success 'rejects invalid -o/--origin' ' ' -test_expect_success 'disallows --bare with --origin' ' +test_expect_success 'clone --bare -o' ' - test_must_fail git clone -o foo --bare parent clone-bare-o 2>err && - test_debug "cat err" && - test_i18ngrep -e "options .--bare. and .--origin foo. cannot be used together" err + git clone -o foo --bare parent clone-bare-o && + (cd parent && pwd) >expect && + git -C clone-bare-o config remote.foo.url >actual && + test_cmp expect actual '