From: Michael Haggerty Date: Sun, 9 Sep 2012 06:19:42 +0000 (+0200) Subject: fetch_pack(): update sought->nr to reflect number of unique entries X-Git-Tag: v1.8.0-rc0~42^2~8 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/4c58f13ba67f9dbe67a351de61703a2db20712cc?hp=4c58f13ba67f9dbe67a351de61703a2db20712cc fetch_pack(): update sought->nr to reflect number of unique entries fetch_pack() removes duplicates from the "sought" list, thereby shrinking the list. But previously, the caller was not informed about the shrinkage. This would cause a spurious error message to be emitted by cmd_fetch_pack() if "git fetch-pack" is called with duplicate refnames. Instead, remove duplicates using string_list_remove_duplicates(), which adjusts sought->nr to reflect the new length of the list. The last test of t5500 inexplicably *required* "git fetch-pack" to fail when fetching a list of references that contains duplicates; i.e., it insisted on the buggy behavior. So change the test to expect the correct behavior. Signed-off-by: Michael Haggerty Signed-off-by: Junio C Hamano ---