Skip to content

Commit 32414ce

Browse files
committed
Merge branch 'jt/submodule-fetch-errmsg'
Error message update. * jt/submodule-fetch-errmsg: submodule: explain first attempt failure clearly
2 parents c063a53 + bd5e567 commit 32414ce

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

git-submodule.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,7 @@ cmd_update()
594594
# is not reachable from a ref.
595595
is_tip_reachable "$sm_path" "$sha1" ||
596596
fetch_in_submodule "$sm_path" $depth ||
597-
say "$(eval_gettext "Unable to fetch in submodule path '\$displaypath'")"
597+
say "$(eval_gettext "Unable to fetch in submodule path '\$displaypath'; trying to directly fetch \$sha1:")"
598598

599599
# Now we tried the usual fetch, but $sha1 may
600600
# not be reachable from any of the refs

submodule.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1548,6 +1548,13 @@ static int fetch_finish(int retvalue, struct strbuf *err,
15481548
struct oid_array *commits;
15491549

15501550
if (retvalue)
1551+
/*
1552+
* NEEDSWORK: This indicates that the overall fetch
1553+
* failed, even though there may be a subsequent fetch
1554+
* by commit hash that might work. It may be a good
1555+
* idea to not indicate failure in this case, and only
1556+
* indicate failure if the subsequent fetch fails.
1557+
*/
15511558
spf->result = 1;
15521559

15531560
if (!task || !task->sub)

0 commit comments

Comments
 (0)