aboutsummaryrefslogtreecommitdiff
path: root/transport.c
diff options
context:
space:
mode:
authorClemens Buchacher <drizzd@aon.at>2009-05-31 16:26:48 +0200
committerJunio C Hamano <gitster@pobox.com>2009-06-01 19:41:24 -0700
commit6d2bf96e550731499c73731e5623017d193f837f (patch)
treebccf71ac9e47910a378878be963a2851a432f74d /transport.c
parent6a01554e6350123c78de805d820e90f1c56e5fdc (diff)
downloadgit-6d2bf96e550731499c73731e5623017d193f837f.tar.gz
git-6d2bf96e550731499c73731e5623017d193f837f.tar.xz
match_refs: search ref list tail internally
Avoid code duplication by moving list tail search to match_refs(). This does not change the semantics, except for http-push, which now inserts to the front of the ref list in order to get rid of the global remote_tail. Signed-off-by: Clemens Buchacher <drizzd@aon.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'transport.c')
-rw-r--r--transport.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/transport.c b/transport.c
index efecb6525..2f5786d38 100644
--- a/transport.c
+++ b/transport.c
@@ -1003,7 +1003,6 @@ int transport_push(struct transport *transport,
if (transport->push_refs) {
struct ref *remote_refs =
transport->get_refs_list(transport, 1);
- struct ref **remote_tail;
struct ref *local_refs = get_local_heads();
int match_flags = MATCH_REFS_NONE;
int verbose = flags & TRANSPORT_PUSH_VERBOSE;
@@ -1014,10 +1013,7 @@ int transport_push(struct transport *transport,
if (flags & TRANSPORT_PUSH_MIRROR)
match_flags |= MATCH_REFS_MIRROR;
- remote_tail = &remote_refs;
- while (*remote_tail)
- remote_tail = &((*remote_tail)->next);
- if (match_refs(local_refs, remote_refs, &remote_tail,
+ if (match_refs(local_refs, &remote_refs,
refspec_nr, refspec, match_flags)) {
return -1;
}