git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 2/4] remote: move append_ref_to_tracked_list to get rid of prototype

From
Jay Soffian <jaysoffian@gmail.com>
Date
Feb 19, 2009, 05:14 UTC
Message-ID
<1235020471-59982-3-git-send-email-jaysoffian@gmail.com>
In-Reply-To
<1235020471-59982-2-git-send-email-jaysoffian@gmail.com>

Relocate the append_ref_to_tracked_list() function above all its callers so that we can get rid of the prototype.

Signed-off-by: Jay Soffian <jaysoffian@gmail.com>
---
Doing this as a separate patch makes the prior patch easier to review,
but I think it could be squashed when you apply the series.
 builtin-remote.c |   37 +++++++++++++++++--------------------
 1 files changed, 17 insertions(+), 20 deletions(-)
diff --git a/builtin-remote.c b/builtin-remote.c
index ea5e808..b61f754 100644
--- a/builtin-remote.c
+++ b/builtin-remote.c
@@ -23,9 +23,6 @@ static int verbose;
 
 static int show_all(void);
 
-static int append_ref_to_tracked_list(const char *refname,
-	const unsigned char *sha1, int flags, void *cb_data);
-
 static inline int postfixcmp(const char *string, const char *postfix)
 {
 	int len1 = strlen(string), len2 = strlen(postfix);
@@ -659,6 +656,23 @@ static void free_remote_ref_states(struct ref_states *states)
 	string_list_clear(&states->heads, 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;
+
+	if (flags & REF_ISSYMREF)
+		return 0;
+
+	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)
@@ -688,23 +702,6 @@ static int get_remote_ref_states(const char *name,
 	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;
-
-	if (flags & REF_ISSYMREF)
-		return 0;
-
-	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 show(int argc, const char **argv)
 {
 	int no_query = 0, result = 0;
-- 
1.6.2.rc1.218.g1b4fab
Previous: Jay SoffianNext: Jay Soffian
Message 3 of 19 in “Improve "remote show" output”
  1. 0/4 Improve "remote show" outputJay Soffian, Feb 19, 2009
  2. 1/4 remote: minor code cleanups in preparation for changing "show" outputJay Soffian, Feb 19, 2009
  3. 2/4 remote: move append_ref_to_tracked_list to get rid of prototypeJay Soffian, Feb 19, 2009
  4. 3/4 string-list: add for_each_string_list()Jay Soffian, Feb 19, 2009
  5. 4/4 remote: new show output styleJay Soffian, Feb 19, 2009
  6. Marc BranchaudFeb 19, 2009
  7. Sverre RabbelierFeb 19, 2009
  8. Marc BranchaudFeb 19, 2009
  9. Sverre RabbelierFeb 19, 2009
  10. Rostislav SvobodaFeb 19, 2009
  11. Jay SoffianFeb 19, 2009
  12. Jay SoffianFeb 19, 2009
  13. Julian PhillipsFeb 19, 2009
  14. Marc BranchaudFeb 20, 2009
  15. Jay SoffianFeb 20, 2009
  16. Johannes SixtFeb 19, 2009
  17. Jay SoffianFeb 19, 2009
  18. Junio C HamanoFeb 20, 2009
  19. Jay SoffianFeb 20, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.