summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e0cc81e)
raw | patch | inline | side by side (parent: e0cc81e)
author | Jay Soffian <jaysoffian@gmail.com> | |
Wed, 25 Feb 2009 08:32:22 +0000 (03:32 -0500) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Fri, 27 Feb 2009 23:19:09 +0000 (15:19 -0800) |
When not querying the remote, show() was having to populate
states.tracked itself. It makes more sense for get_remote_ref_states()
to do this consistently. Since show() is the only caller of
get_remote_ref_states() with query=0, this change does not affect
other callers.
Signed-off-by: Jay Soffian <jaysoffian@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
states.tracked itself. It makes more sense for get_remote_ref_states()
to do this consistently. Since show() is the only caller of
get_remote_ref_states() with query=0, this change does not affect
other callers.
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 fc02e5f34bf28fc1d7b45ba67cc4499646159874..1b5e8b6811a04f1b880a669502e0906414702896 100644 (file)
--- a/builtin-remote.c
+++ b/builtin-remote.c
string_list_clear(&states->tracked, 0);
}
+static int append_ref_to_tracked_list(const char *refname,
+ const unsigned char *sha1, int flags, void *cb_data)
+{
+ struct ref_states *states = cb_data;
+ struct refspec refspec;
+
+ memset(&refspec, 0, sizeof(refspec));
+ refspec.dst = (char *)refname;
+ if (!remote_find_tracking(states->remote, &refspec))
+ string_list_append(abbrev_branch(refspec.src), &states->tracked);
+
+ return 0;
+}
+
static int get_remote_ref_states(const char *name,
struct ref_states *states,
int query)
transport_disconnect(transport);
get_ref_states(remote_refs, states);
- }
-
- return 0;
-}
-
-static int append_ref_to_tracked_list(const char *refname,
- const unsigned char *sha1, int flags, void *cb_data)
-{
- struct ref_states *states = cb_data;
- struct refspec refspec;
-
- memset(&refspec, 0, sizeof(refspec));
- refspec.dst = (char *)refname;
- if (!remote_find_tracking(states->remote, &refspec))
- string_list_append(abbrev_branch(refspec.src), &states->tracked);
+ } else
+ for_each_ref(append_ref_to_tracked_list, states);
return 0;
}
"prune')", &states.stale, "");
}
- if (no_query)
- for_each_ref(append_ref_to_tracked_list, &states);
show_list(" Tracked remote branch%s", &states.tracked, "");
if (states.remote->push_refspec_nr) {