@matheusbsbs / matheus-bagliano / commits / a0022eebf3
Fork 0

shallow repository: disable unsupported operations for now.

We currently do not support fetching/cloning from a shallow repository nor pushing into one. Make sure these are not attempted so that we do not have to worry about corrupting repositories needlessly. Signed-off-by: Junio C Hamano <junkio@cox.net>

Junio C Hamano committed Jan 21, 2007 at 22:23 UTC a0022eebf345a4515c7d148c303911010b1fa834
2 files changed +5 -1
receive-pack.c
+3
@@ -421,6 +421,9 @@ int main(int argc, char **argv)
421 if (!enter_repo(dir, 0))
422 die("'%s': unable to chdir or not a git archive", dir);
423
424 + if (is_repository_shallow())
425 + die("attempt to push into a shallow repository");
426 +
427 setup_ident();
428 /* don't die if gecos is empty */
429 ignore_missing_committer_name();
upload-pack.c
+2 -1
@@ -672,7 +672,8 @@ int main(int argc, char **argv)
672
673 if (!enter_repo(dir, strict))
674 die("'%s': unable to chdir or not a git archive", dir);
675 -
675 + if (is_repository_shallow())
676 + die("attempt to fetch/clone from a shallow repository");
677 upload_pack();
678 return 0;
679 }