summaryrefslogtreecommitdiff
path: root/builtin/fetch.c
diff options
context:
space:
mode:
authorMichael Haggerty <mhagger@alum.mit.edu>2013-10-30 05:33:09 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-10-30 21:16:41 (GMT)
commitb9afe6654db2bfb776db933f832e7e03052adf98 (patch)
treeb88e6f7c317f436739cd15d8942bc00518d391c2 /builtin/fetch.c
parent2071e05ed27df847e300b51aca661a34a765aea3 (diff)
downloadgit-b9afe6654db2bfb776db933f832e7e03052adf98.zip
git-b9afe6654db2bfb776db933f832e7e03052adf98.tar.gz
git-b9afe6654db2bfb776db933f832e7e03052adf98.tar.bz2
ref_remove_duplicates(): simplify loop logic
Change the loop body into the more straightforward * remove item from the front of the old list * if necessary, add it to the tail of the new list and return a pointer to the new list (even though it is currently always the same as the input argument, because the first element in the list is currently never deleted). Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/fetch.c')
-rw-r--r--builtin/fetch.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/builtin/fetch.c b/builtin/fetch.c
index 5ddb9af..3d978eb 100644
--- a/builtin/fetch.c
+++ b/builtin/fetch.c
@@ -360,9 +360,7 @@ static struct ref *get_ref_map(struct transport *transport,
tail = &rm->next;
}
- ref_remove_duplicates(ref_map);
-
- return ref_map;
+ return ref_remove_duplicates(ref_map);
}
#define STORE_REF_ERROR_OTHER 1