git-upload-pack: make sure we close unused pipe ends
[gitweb.git] / upload-pack.c
index 3a466c6a3e66fdde2bb20b580db841c0600190bb..044c33b09091eefff4f6035286c0b4bd4adf155e 100644 (file)
@@ -119,6 +119,7 @@ static void create_pack_file(void)
                int i;
                struct rev_info revs;
 
+               close(lp_pipe[0]);
                pack_pipe = fdopen(lp_pipe[1], "w");
 
                if (create_full_pack)
@@ -672,7 +673,8 @@ int main(int argc, char **argv)
 
        if (!enter_repo(dir, strict))
                die("'%s': unable to chdir or not a git archive", dir);
-
+       if (is_repository_shallow())
+               die("attempt to fetch/clone from a shallow repository");
        upload_pack();
        return 0;
 }