summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--receive-pack.c3
-rw-r--r--upload-pack.c3
2 files changed, 5 insertions, 1 deletions
diff --git a/receive-pack.c b/receive-pack.c
index c176d8fd00..6333f00c6e 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 3a466c6a3e..3648aae1a7 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;
}