]> git.ipfire.org Git - thirdparty/git.git/commit - builtin/receive-pack.c
receive-pack: avoid duplicates between our refs and alternates
authorJeff King <peff@peff.net>
Wed, 8 Feb 2017 20:53:19 +0000 (15:53 -0500)
committerJunio C Hamano <gitster@pobox.com>
Wed, 8 Feb 2017 23:39:55 +0000 (15:39 -0800)
commit63d428e656edcd670fa87e74136726096ff3de6f
tree6d9944c060c9a9d060409be10e96c3a8fdf55515
parent8b24b9e76534b6664d4ea1afa67db0fbb495c925
receive-pack: avoid duplicates between our refs and alternates

We de-duplicate ".have" refs among themselves, but never
check if they are duplicates of our local refs. It's not
unreasonable that they would be if we are a "--shared" or
"--reference" clone of a similar repository; we'd have all
the same tags.

We can handle this by inserting our local refs into the
oidset, but obviously not suppressing duplicates (since the
refnames are important).

Note that this also switches the order in which we advertise
refs, processing ours first and then any alternates. The
order shouldn't matter (and arguably showing our refs first
makes more sense).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/receive-pack.c
t/t5400-send-pack.sh