Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Haggerty <mhagger@alum.mit.edu>2012-09-09 10:19:41 +0400
committerJunio C Hamano <gitster@pobox.com>2012-09-12 22:46:31 +0400
commit382a96711470489ea6e4e277accd3afc46526bfc (patch)
tree061a8f50b081cc31daf5634d879b87242e15d369 /builtin/fetch-pack.c
parent8bee93dd24731a1d2ef7c82d484a893cf68b6572 (diff)
filter_refs(): do not check the same sought_pos twice
Once a match has been found at sought_pos, the entry is zeroed and no future attempts will match that entry. So increment sought_pos to avoid checking against the zeroed-out entry during the next iteration. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/fetch-pack.c')
-rw-r--r--builtin/fetch-pack.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/fetch-pack.c b/builtin/fetch-pack.c
index df81995eab..63d455ffef 100644
--- a/builtin/fetch-pack.c
+++ b/builtin/fetch-pack.c
@@ -565,8 +565,8 @@ static void filter_refs(struct ref **refs, struct string_list *sought)
if (cmp < 0) /* definitely do not have it */
break;
else if (cmp == 0) { /* definitely have it */
- sought->items[sought_pos].string[0] = '\0';
return_refs[sought_pos] = ref;
+ sought->items[sought_pos++].string[0] = '\0';
break;
}
else /* might have it; keep looking */