diff options
| author | Junio C Hamano <gitster@pobox.com> | 2022-10-10 10:08:39 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2022-10-10 10:08:39 -0700 |
| commit | 7aeb0d4c47878a04e19cffe2ddf20d642df56414 (patch) | |
| tree | 1b01cb6f5a50c867f473d40b0a40ad016b5f2339 | |
| parent | fdbfac60fd889d4e55244958ce7febd61cb53f9d (diff) | |
| parent | 3b910d6e2911a48a2a6945094f79dacd5367b799 (diff) | |
| download | git-7aeb0d4c47878a04e19cffe2ddf20d642df56414.tar.xz | |
Merge branch 'jk/clone-allow-bare-and-o-together'
"git clone" did not like to see the "--bare" and the "--origin"
options used together without a good reason.
* jk/clone-allow-bare-and-o-together:
clone: allow "--bare" with "-o"
| -rw-r--r-- | builtin/clone.c | 3 | ||||
| -rwxr-xr-x | t/t5606-clone-options.sh | 9 |
2 files changed, 5 insertions, 7 deletions
diff --git a/builtin/clone.c b/builtin/clone.c index d269d6fec6..ed8d44bb6a 100644 --- a/builtin/clone.c +++ b/builtin/clone.c @@ -929,9 +929,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 f6bb02ab94..cf221e92c4 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 ' |
