From: Junio C Hamano Date: Tue, 24 Jul 2018 21:50:43 +0000 (-0700) Subject: Merge branch 'sb/submodule-move-head-error-msg' X-Git-Tag: v2.19.0-rc0~142 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/392b3dde513083b9975c990cd2cf410d2846b941?hp=--cc Merge branch 'sb/submodule-move-head-error-msg' "git checkout --recurse-submodules another-branch" did not report in which submodule it failed to update the working tree, which resulted in an unhelpful error message. * sb/submodule-move-head-error-msg: submodule.c: report the submodule that an error occurs in --- 392b3dde513083b9975c990cd2cf410d2846b941 diff --cc submodule.c index d3a9aab83d,1b950f9627..2a6381864e --- a/submodule.c +++ b/submodule.c @@@ -1677,12 -1658,12 +1677,12 @@@ int submodule_move_head(const char *pat argv_array_push(&cp.args, "-m"); if (!(flags & SUBMODULE_MOVE_HEAD_FORCE)) - argv_array_push(&cp.args, old ? old : EMPTY_TREE_SHA1_HEX); + argv_array_push(&cp.args, old_head ? old_head : empty_tree_oid_hex()); - argv_array_push(&cp.args, new ? new : EMPTY_TREE_SHA1_HEX); + argv_array_push(&cp.args, new_head ? new_head : empty_tree_oid_hex()); if (run_command(&cp)) { - ret = -1; + ret = error(_("Submodule '%s' could not be updated."), path); goto out; }