X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=fetch-pack.c;h=65659826601eb9c850266539f6c9e7807a0b467e;hb=ad7db62113368279a1b6994790bf30925fabea33;hp=cb2171523c6f30911b1d80d622d709b7f39fdb97;hpb=9534f40bc42dd826cc26c8c8c84f6a8a5fc569f6;p=git.git diff --git a/fetch-pack.c b/fetch-pack.c index cb217152..65659826 100644 --- a/fetch-pack.c +++ b/fetch-pack.c @@ -458,5 +458,19 @@ int main(int argc, char **argv) close(fd[0]); close(fd[1]); finish_connect(pid); + + if (!ret && nr_heads) { + /* If the heads to pull were given, we should have + * consumed all of them by matching the remote. + * Otherwise, 'git-fetch remote no-such-ref' would + * silently succeed without issuing an error. + */ + for (i = 0; i < nr_heads; i++) + if (heads[i] && heads[i][0]) { + error("no such remote ref %s", heads[i]); + ret = 1; + } + } + return ret; }