sha1_file.c: don't ignore an error condition in sha1_loose_object_info()
[gitweb.git] / send-pack.c
index cd478dd82fdc08094873112b40cbf302623ecc21..512b660e99f26e391df34d48e1aebc9c6c3250e7 100644 (file)
@@ -25,6 +25,8 @@ static int pack_objects(int fd, struct ref *refs)
        if (pipe(pipe_fd) < 0)
                return error("send-pack: pipe failed");
        pid = fork();
+       if (pid < 0)
+               return error("send-pack: unable to fork git-pack-objects");
        if (!pid) {
                /*
                 * The child becomes pack-objects --revs; we feed
@@ -377,11 +379,11 @@ int main(int argc, char **argv)
                char *arg = *argv;
 
                if (*arg == '-') {
-                       if (!strncmp(arg, "--receive-pack=", 15)) {
+                       if (!prefixcmp(arg, "--receive-pack=")) {
                                receivepack = arg + 15;
                                continue;
                        }
-                       if (!strncmp(arg, "--exec=", 7)) {
+                       if (!prefixcmp(arg, "--exec=")) {
                                receivepack = arg + 7;
                                continue;
                        }