Skip to content

Commit 8cb560f

Browse files
dschogitster
authored andcommitted
git fetch-pack: do not complain about "no common commits" in an empty repo
If the repo is empty, it is obvious that there are no common commits when fetching from _anywhere_. So there is no use in saying it in that case, and it can even be annoying. Therefore suppress the message unilaterally if the repository is empty prior to the fetch. Signed-off-by: Johannes Schindelin <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent dc49308 commit 8cb560f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

builtin-fetch-pack.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,8 @@ static int find_common(int fd[2], unsigned char *result_sha1,
309309
}
310310
flushes--;
311311
}
312-
return retval;
312+
/* it is no error to fetch into a completely empty repo */
313+
return count ? retval : 0;
313314
}
314315

315316
static struct commit_list *complete;

0 commit comments

Comments
 (0)