From: Junio C Hamano Date: Mon, 22 Jan 2007 06:23:58 +0000 (-0800) Subject: shallow repository: disable unsupported operations for now. X-Git-Tag: v1.5.0-rc3~90 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=a0022eebf345a4515c7d148c303911010b1fa834;p=git.git 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 --- diff --git a/receive-pack.c b/receive-pack.c index c176d8fd0..6333f00c6 100644 --- a/receive-pack.c +++ b/receive-pack.c @@ -421,6 +421,9 @@ int main(int argc, char **argv) if (!enter_repo(dir, 0)) die("'%s': unable to chdir or not a git archive", dir); + if (is_repository_shallow()) + die("attempt to push into a shallow repository"); + setup_ident(); /* don't die if gecos is empty */ ignore_missing_committer_name(); diff --git a/upload-pack.c b/upload-pack.c index 3a466c6a3..3648aae1a 100644 --- a/upload-pack.c +++ b/upload-pack.c @@ -672,7 +672,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; }