git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 2/2] repack: retain the return value of pack-objects

From
Stefan Beller <stefanbeller@googlemail.com>
Date
Aug 29, 2013, 20:39 UTC
Message-ID
<1377808774-12505-3-git-send-email-stefanbeller@googlemail.com>
In-Reply-To
<1377808774-12505-1-git-send-email-stefanbeller@googlemail.com>

During the review process of the previous commit (repack: rewrite the shell script in C), Johannes Sixt proposed to retain any exit codes from the sub-process, which makes it probably more obvious in case of failure.

As the commit before should behave as close to the original shell script, the proposed change is put in this extra commit. The infrastructure however was already setup in the previous commit. (Having a local 'ret' variable)

Signed-off-by: Stefan Beller <stefanbeller@googlemail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 builtin/repack.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/builtin/repack.c b/builtin/repack.c
index 0cc823d..2fb3b91 100644
--- a/builtin/repack.c
+++ b/builtin/repack.c
@@ -229,7 +229,7 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
 
 	ret = start_command(&cmd);
 	if (ret)
-		return 1;
+		return ret;
 
 	nr_packs = 0;
 	out = xfdopen(cmd.out, "r");
@@ -242,7 +242,7 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
 	fclose(out);
 	ret = finish_command(&cmd);
 	if (ret)
-		return 1;
+		return ret;
 	argv_array_clear(&cmd_args);
 
 	if (!nr_packs && !quiet)
-- 
1.8.4
Previous: Stefan BellerNext: Junio C Hamano
Message 7 of 9 in “[PATCHv7 0/2] Rewriting repack in C”
  1. Stefan BellerAug 29, 2013
  2. 1/2 repack: rewrite the shell script in CStefan Beller, Aug 29, 2013
  3. Felipe ContrerasAug 29, 2013
  4. René ScharfeSep 15, 2013
  5. Stefan BellerSep 15, 2013
  6. Stefan BellerSep 17, 2013
  7. 2/2 repack: retain the return value of pack-objectsStefan Beller, Aug 29, 2013
  8. Junio C HamanoAug 29, 2013
  9. Stefan BellerAug 30, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.