repack: retain the return value of pack-objects
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>
Stefan Beller committed
Sep 15, 2013 at 17:33 UTC
ffc9329f48cb05ab44592e75e2dac4cfb7951c00
1 file changed
+2
-2
builtin/repack.c
+2
-2
@@ -231,7 +231,7 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
231
232
ret = start_command(&cmd);
233
if (ret)
234
- return 1;
234
+ return ret;
235
236
nr_packs = 0;
237
out = xfdopen(cmd.out, "r");
@@ -244,7 +244,7 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
244
fclose(out);
245
ret = finish_command(&cmd);
246
if (ret)
247
- return 1;
247
+ return ret;
248
argv_array_clear(&cmd_args);
249
250
if (!nr_packs && !quiet)