Code

git fetch-pack: do not complain about "no common commits" in an empty repo
authorJohannes Schindelin <Johannes.Schindelin@gmx.de>
Wed, 2 Jul 2008 17:06:56 +0000 (18:06 +0100)
committerJunio C Hamano <gitster@pobox.com>
Wed, 16 Jul 2008 22:53:43 +0000 (15:53 -0700)
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 <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-fetch-pack.c

index de1e8d1365769c7c841749901f705c0b6a78eab3..6e98cafd08ca9fb09d4f860878691db9ec4999ba 100644 (file)
@@ -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;