path: root/upload-pack.c
diff options
authorNguyễn Thái Ngọc Duy <>2013-12-05 13:02:41 (GMT)
committerJunio C Hamano <>2013-12-11 00:14:17 (GMT)
commit79d3a236c551ad59719a6835bee03a1446296e65 (patch)
treea23554e47b3d83df429dda8e9fbe7c33a1b8cb58 /upload-pack.c
parent4820a33baa963c4559736d7a1c4c35f8dcb37293 (diff)
upload-pack: make sure deepening preserves shallow roots
When "fetch --depth=N" where N exceeds the longest chain of history in the source repo, usually we just send an "unshallow" line to the client so full history is obtained. When the source repo is shallow we need to make sure to "unshallow" the current shallow point _and_ "shallow" again when the commit reaches its shallow bottom in the source repo. This should fix both cases: large <N> and --unshallow. Signed-off-by: Nguyễn Thái Ngọc Duy <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'upload-pack.c')
1 files changed, 1 insertions, 1 deletions
diff --git a/upload-pack.c b/upload-pack.c
index f082f06..28269c7 100644
--- a/upload-pack.c
+++ b/upload-pack.c
@@ -619,7 +619,7 @@ static void receive_needs(void)
if (depth > 0) {
struct commit_list *result = NULL, *backup = NULL;
int i;
- if (depth == INFINITE_DEPTH)
+ if (depth == INFINITE_DEPTH && !is_repository_shallow())
for (i = 0; i <; i++) {
struct object *object = shallows.objects[i].item;
object->flags |= NOT_SHALLOW;