builtin/blame.c: struct blame_entry does not need a prev link
[gitweb.git] / builtin / send-pack.c
index 961df04deaf9497074db9f5ad1790962cd67e402..f420b74665bcf1746e94b4cc5eb66ded0a2235ff 100644 (file)
@@ -101,6 +101,7 @@ int cmd_send_pack(int argc, const char **argv, const char *prefix)
        int fd[2];
        struct child_process *conn;
        struct sha1_array extra_have = SHA1_ARRAY_INIT;
+       struct sha1_array shallow = SHA1_ARRAY_INIT;
        struct ref *remote_refs, *local_refs;
        int ret;
        int helper_status = 0;
@@ -116,15 +117,15 @@ int cmd_send_pack(int argc, const char **argv, const char *prefix)
                const char *arg = *argv;
 
                if (*arg == '-') {
-                       if (!prefixcmp(arg, "--receive-pack=")) {
+                       if (starts_with(arg, "--receive-pack=")) {
                                receivepack = arg + 15;
                                continue;
                        }
-                       if (!prefixcmp(arg, "--exec=")) {
+                       if (starts_with(arg, "--exec=")) {
                                receivepack = arg + 7;
                                continue;
                        }
-                       if (!prefixcmp(arg, "--remote=")) {
+                       if (starts_with(arg, "--remote=")) {
                                remote_name = arg + 9;
                                continue;
                        }
@@ -182,7 +183,7 @@ int cmd_send_pack(int argc, const char **argv, const char *prefix)
                                        exit(1);
                                continue;
                        }
-                       if (!prefixcmp(arg, "--" CAS_OPT_NAME "=")) {
+                       if (starts_with(arg, "--" CAS_OPT_NAME "=")) {
                                if (parse_push_cas_option(&cas,
                                                          strchr(arg, '=') + 1, 0) < 0)
                                        exit(1);
@@ -208,9 +209,6 @@ int cmd_send_pack(int argc, const char **argv, const char *prefix)
            (send_all && args.send_mirror))
                usage(send_pack_usage);
 
-       if (is_repository_shallow())
-               die("attempt to push from a shallow repository");
-
        if (remote_name) {
                remote = remote_get(remote_name);
                if (!remote_has_url(remote, dest)) {
@@ -232,7 +230,8 @@ int cmd_send_pack(int argc, const char **argv, const char *prefix)
                        args.verbose ? CONNECT_VERBOSE : 0);
        }
 
-       get_remote_heads(fd[0], NULL, 0, &remote_refs, REF_NORMAL, &extra_have);
+       get_remote_heads(fd[0], NULL, 0, &remote_refs, REF_NORMAL,
+                        &extra_have, &shallow);
 
        transport_verify_remote_names(nr_refspecs, refspecs);