Skip to content

Commit 65da938

Browse files
derrickstoleegitster
authored andcommitted
clone: warn on failure to repo_init()
The --bundle-uri option was added in 5556891 (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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent e21e663 commit 65da938

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

builtin/clone.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1245,8 +1245,9 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
12451245
*/
12461246
if (bundle_uri) {
12471247
/* At this point, we need the_repository to match the cloned repo. */
1248-
repo_init(the_repository, git_dir, work_tree);
1249-
if (fetch_bundle_uri(the_repository, bundle_uri))
1248+
if (repo_init(the_repository, git_dir, work_tree))
1249+
warning(_("failed to initialize the repo, skipping bundle URI"));
1250+
else if (fetch_bundle_uri(the_repository, bundle_uri))
12501251
warning(_("failed to fetch objects from bundle URI '%s'"),
12511252
bundle_uri);
12521253
}

0 commit comments

Comments
 (0)