OSDN Git Service

repack: retain the return value of pack-objects
authorStefan Beller <stefanbeller@googlemail.com>
Sun, 15 Sep 2013 15:33:21 +0000 (17:33 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 17 Sep 2013 20:34:56 +0000 (13:34 -0700)
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

index 52846f8..9f4c782 100644 (file)
@@ -231,7 +231,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");
@@ -244,7 +244,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)