Merge branch 'jt/submodule-fetch-errmsg'
authorJunio C Hamano <gitster@pobox.com>
Tue, 9 Apr 2019 17:14:26 +0000 (02:14 +0900)
committerJunio C Hamano <gitster@pobox.com>
Tue, 9 Apr 2019 17:14:26 +0000 (02:14 +0900)
Error message update.

* jt/submodule-fetch-errmsg:
  submodule: explain first attempt failure clearly

git-submodule.sh
submodule.c

index 514ede2..2c0fb6d 100755 (executable)
@@ -594,7 +594,7 @@ cmd_update()
                                # is not reachable from a ref.
                                is_tip_reachable "$sm_path" "$sha1" ||
                                fetch_in_submodule "$sm_path" $depth ||
-                               say "$(eval_gettext "Unable to fetch in submodule path '\$displaypath'")"
+                               say "$(eval_gettext "Unable to fetch in submodule path '\$displaypath'; trying to directly fetch \$sha1:")"
 
                                # Now we tried the usual fetch, but $sha1 may
                                # not be reachable from any of the refs
index 21cf50c..b16c0ec 100644 (file)
@@ -1548,6 +1548,13 @@ static int fetch_finish(int retvalue, struct strbuf *err,
        struct oid_array *commits;
 
        if (retvalue)
+               /*
+                * NEEDSWORK: This indicates that the overall fetch
+                * failed, even though there may be a subsequent fetch
+                * by commit hash that might work. It may be a good
+                * idea to not indicate failure in this case, and only
+                * indicate failure if the subsequent fetch fails.
+                */
                spf->result = 1;
 
        if (!task || !task->sub)