From ebcce310f2018b26a21b2926490209f5550620fe Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Wed, 2 Jul 2008 18:06:56 +0100 Subject: [PATCH] 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 Signed-off-by: Junio C Hamano --- builtin-fetch-pack.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/builtin-fetch-pack.c b/builtin-fetch-pack.c index de1e8d1365..6e98cafd08 100644 --- a/builtin-fetch-pack.c +++ b/builtin-fetch-pack.c @@ -309,7 +309,8 @@ done: } flushes--; } - return retval; + /* it is no error to fetch into a completely empty repo */ + return count ? retval : 0; } static struct commit_list *complete; -- 2.11.4.GIT