]> git.ipfire.org Git - thirdparty/git.git/blobdiff - upload-pack.c
make the sender advertise shallow commits to the receiver
[thirdparty/git.git] / upload-pack.c
index c989a737f975b3aef41ffb9f6ec669ce3b2f2c2b..38b2a2911044646b6673344d77a56062b6170023 100644 (file)
@@ -758,6 +758,7 @@ static void upload_pack(void)
                reset_timeout();
                head_ref_namespaced(send_ref, &symref);
                for_each_namespaced_ref(send_ref, &symref);
+               advertise_shallow_grafts(1);
                packet_flush(1);
        } else {
                head_ref_namespaced(mark_our_ref, NULL);
@@ -835,8 +836,9 @@ int main(int argc, char **argv)
 
        if (!enter_repo(dir, strict))
                die("'%s' does not appear to be a git repository", dir);
-       if (is_repository_shallow())
-               die("attempt to fetch/clone from a shallow repository");
+       if (is_repository_shallow() && stateless_rpc)
+               die("attempt to push into a shallow repository");
+
        git_config(upload_pack_config, NULL);
        upload_pack();
        return 0;