Skip to content

Commit 392b3dd

Browse files
committed
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
2 parents a9e7fe9 + ba95d4e commit 392b3dd

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

submodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1682,7 +1682,7 @@ int submodule_move_head(const char *path,
16821682
argv_array_push(&cp.args, new_head ? new_head : empty_tree_oid_hex());
16831683

16841684
if (run_command(&cp)) {
1685-
ret = -1;
1685+
ret = error(_("Submodule '%s' could not be updated."), path);
16861686
goto out;
16871687
}
16881688

t/lib-submodule-update.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -782,7 +782,8 @@ test_submodule_recursing_with_args_common() {
782782
(
783783
cd submodule_update &&
784784
git branch -t invalid_sub1 origin/invalid_sub1 &&
785-
test_must_fail $command invalid_sub1 &&
785+
test_must_fail $command invalid_sub1 2>err &&
786+
test_i18ngrep sub1 err &&
786787
test_superproject_content origin/add_sub1 &&
787788
test_submodule_content sub1 origin/add_sub1
788789
)

0 commit comments

Comments
 (0)