aboutsummaryrefslogtreecommitdiffstats
path: root/builtin/submodule--helper.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2024-09-30 16:16:14 -0700
committerJunio C Hamano <gitster@pobox.com>2024-09-30 16:16:15 -0700
commit22baac889235bb3752ae36baec36f345871ac939 (patch)
treec933fdde036ec7033b2237c6f0319170638d2554 /builtin/submodule--helper.c
parentab68c70a8b90626be24d95a27f6495ab6e7e57a5 (diff)
parent082caf527ea769635e8c46d0cc181c844c50defd (diff)
downloadgit-22baac889235bb3752ae36baec36f345871ac939.tar.gz
Merge branch 'pw/submodule-process-sigpipe'
When a subprocess to work in a submodule spawned by "git submodule" fails with SIGPIPE, the parent Git process caught the death of it, but gave a generic "failed to work in that submodule", which was misleading. We now behave as if the parent got SIGPIPE and die. * pw/submodule-process-sigpipe: submodule status: propagate SIGPIPE
Diffstat (limited to 'builtin/submodule--helper.c')
-rw-r--r--builtin/submodule--helper.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c
index a1ada86952..8d36aefbe6 100644
--- a/builtin/submodule--helper.c
+++ b/builtin/submodule--helper.c
@@ -696,6 +696,7 @@ static void status_submodule(const char *path, const struct object_id *ce_oid,
if (flags & OPT_RECURSIVE) {
struct child_process cpr = CHILD_PROCESS_INIT;
+ int res;
cpr.git_cmd = 1;
cpr.dir = path;
@@ -711,7 +712,10 @@ static void status_submodule(const char *path, const struct object_id *ce_oid,
if (flags & OPT_QUIET)
strvec_push(&cpr.args, "--quiet");
- if (run_command(&cpr))
+ res = run_command(&cpr);
+ if (res == SIGPIPE + 128)
+ raise(SIGPIPE);
+ else if (res)
die(_("failed to recurse into submodule '%s'"), path);
}