Skip to content

Commit

Permalink
git fetch-pack: do not complain about "no common commits" in an empty…
Browse files Browse the repository at this point in the history
… 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 <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Johannes Schindelin authored and Junio C Hamano committed Jul 2, 2008
1 parent dc49308 commit 8cb560f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion builtin-fetch-pack.c
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,8 @@ static int find_common(int fd[2], unsigned char *result_sha1,
}
flushes--;
}
return retval;
/* it is no error to fetch into a completely empty repo */
return count ? retval : 0;
}

static struct commit_list *complete;
Expand Down

0 comments on commit 8cb560f

Please sign in to comment.