diff options
author | Derrick Stolee <derrickstolee@github.com> | 2022-08-23 14:05:13 (GMT) |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-08-24 15:46:36 (GMT) |
commit | 65da93891680edc0d1471d436d92d4da7d0b4465 (patch) | |
tree | 40302e1b87a94f07bd8c05c5ce03c60b21318b17 /builtin/clone.c | |
parent | e21e663cd1942df29979d3e01f7eacb532727bb7 (diff) | |
download | git-65da93891680edc0d1471d436d92d4da7d0b4465.zip git-65da93891680edc0d1471d436d92d4da7d0b4465.tar.gz git-65da93891680edc0d1471d436d92d4da7d0b4465.tar.bz2 |
clone: warn on failure to repo_init()
The --bundle-uri option was added in 55568919616 (clone: add
--bundle-uri option, 2022-08-09), but this also introduced a call to
repo_init() whose return value was ignored. Fix that ignored value by
warning that the bundle URI process could not continue if it failed.
Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/clone.c')
-rw-r--r-- | builtin/clone.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/builtin/clone.c b/builtin/clone.c index 4463789..e21d42d 100644 --- a/builtin/clone.c +++ b/builtin/clone.c @@ -1245,8 +1245,9 @@ int cmd_clone(int argc, const char **argv, const char *prefix) */ if (bundle_uri) { /* At this point, we need the_repository to match the cloned repo. */ - repo_init(the_repository, git_dir, work_tree); - if (fetch_bundle_uri(the_repository, bundle_uri)) + if (repo_init(the_repository, git_dir, work_tree)) + warning(_("failed to initialize the repo, skipping bundle URI")); + else if (fetch_bundle_uri(the_repository, bundle_uri)) warning(_("failed to fetch objects from bundle URI '%s'"), bundle_uri); } |