summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c6f5a7a)
raw | patch | inline | side by side (parent: c6f5a7a)
author | Jay Soffian <jaysoffian@gmail.com> | |
Wed, 25 Feb 2009 08:32:19 +0000 (03:32 -0500) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Fri, 27 Feb 2009 23:19:08 +0000 (15:19 -0800) |
This patch moves identical lines of code into a cleanup function. The
function has two callers and is about to gain a third.
Also removed a bogus NEEDSWORK comment per Daniel Barkalow:
Actually, the comment is wrong; "remote" comes from remote_get(),
which returns things from a cache in remote.c; there could be a
remote_put() to let the code know that the caller is done with the
object, but it wouldn't presently do anything.
Signed-off-by: Jay Soffian <jaysoffian@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
function has two callers and is about to gain a third.
Also removed a bogus NEEDSWORK comment per Daniel Barkalow:
Actually, the comment is wrong; "remote" comes from remote_get(),
which returns things from a cache in remote.c; there could be a
remote_put() to let the code know that the caller is done with the
object, but it wouldn't presently do anything.
Signed-off-by: Jay Soffian <jaysoffian@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-remote.c | patch | blob | history |
diff --git a/builtin-remote.c b/builtin-remote.c
index ac69d37c8af415a64cba88a888e9b80db95ef97a..b89a3534de8ddf2d8dfa78123833e8696426ffe0 100644 (file)
--- a/builtin-remote.c
+++ b/builtin-remote.c
printf(" %s\n", list->items[i].string);
}
+static void free_remote_ref_states(struct ref_states *states)
+{
+ string_list_clear(&states->new, 0);
+ string_list_clear(&states->stale, 0);
+ string_list_clear(&states->tracked, 0);
+}
+
static int get_remote_ref_states(const char *name,
struct ref_states *states,
int query)
}
}
- /* NEEDSWORK: free remote */
- string_list_clear(&states.new, 0);
- string_list_clear(&states.stale, 0);
- string_list_clear(&states.tracked, 0);
+ free_remote_ref_states(&states);
}
return result;
warn_dangling_symref(dangling_msg, refname);
}
- /* NEEDSWORK: free remote */
- string_list_clear(&states.new, 0);
- string_list_clear(&states.stale, 0);
- string_list_clear(&states.tracked, 0);
+ free_remote_ref_states(&states);
}
return result;