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

[PATCH 2/6] add_extra_ref(): remove flag argument

From
mhagger@alum.mit.edu <mhagger@alum.mit.edu>
Date
Dec 13, 2011, 20:06 UTC
Message-ID
<1323806811-5798-3-git-send-email-mhagger@alum.mit.edu>
In-Reply-To
<1323806811-5798-1-git-send-email-mhagger@alum.mit.edu>
From: Michael Haggerty <mhagger@alum.mit.edu>

The argument was always set to 0 (and other values do not make sense) so remove the argument.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
---
 builtin/clone.c        |    4 ++--
 builtin/receive-pack.c |    2 +-
 refs.c                 |    4 ++--
 refs.h                 |    2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/builtin/clone.c b/builtin/clone.c
index efe8b6c..5035767 100644
--- a/builtin/clone.c
+++ b/builtin/clone.c
@@ -252,7 +252,7 @@ static int add_one_reference(struct string_list_item *item, void *cb_data)
 	transport = transport_get(remote, ref_git);
 	for (extra = transport_get_remote_refs(transport); extra;
 	     extra = extra->next)
-		add_extra_ref(extra->name, extra->old_sha1, 0);
+		add_extra_ref(extra->name, extra->old_sha1);
 
 	transport_disconnect(transport);
 	free(ref_git);
@@ -441,7 +441,7 @@ static void write_remote_refs(const struct ref *local_refs)
 	for (r = local_refs; r; r = r->next) {
 		if (!r->peer_ref)
 			continue;
-		add_extra_ref(r->peer_ref->name, r->old_sha1, 0);
+		add_extra_ref(r->peer_ref->name, r->old_sha1);
 	}
 
 	pack_refs(PACK_REFS_ALL);
diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c
index b6d957c..e3b46ce 100644
--- a/builtin/receive-pack.c
+++ b/builtin/receive-pack.c
@@ -872,7 +872,7 @@ static int delete_only(struct command *commands)
 
 static void add_one_alternate_sha1(const unsigned char sha1[20], void *unused)
 {
-	add_extra_ref(".have", sha1, 0);
+	add_extra_ref(".have", sha1);
 }
 
 static void collect_one_alternate_ref(const struct ref *ref, void *data)
diff --git a/refs.c b/refs.c
index f5cb297..6115487 100644
--- a/refs.c
+++ b/refs.c
@@ -248,9 +248,9 @@ static void read_packed_refs(FILE *f, struct ref_array *array)
 	sort_ref_array(array);
 }
 
-void add_extra_ref(const char *name, const unsigned char *sha1, int flag)
+void add_extra_ref(const char *name, const unsigned char *sha1)
 {
-	add_ref(name, sha1, flag, 0, &extra_refs, NULL);
+	add_ref(name, sha1, 0, 0, &extra_refs, NULL);
 }
 
 void clear_extra_refs(void)
diff --git a/refs.h b/refs.h
index 3fd5536..39bb289 100644
--- a/refs.h
+++ b/refs.h
@@ -56,7 +56,7 @@ extern void warn_dangling_symref(FILE *fp, const char *msg_fmt, const char *refn
  * called. Only extra refs added before for_each_ref() is called will
  * be listed on a given call of for_each_ref().
  */
-extern void add_extra_ref(const char *refname, const unsigned char *sha1, int flags);
+extern void add_extra_ref(const char *refname, const unsigned char *sha1);
 extern void clear_extra_refs(void);
 extern int ref_exists(const char *);
 
-- 
1.7.8
Previous: mhagger@alum.mit.eduNext: mhagger@alum.mit.edu
Message 3 of 7 in “Handle extra_refs separately from ref_caches”
  1. 0/6 Handle extra_refs separately from ref_cachesmhagger@alum.mit.edu, Dec 13, 2011
  2. 1/6 t5519: push two branches to alternate repomhagger@alum.mit.edu, Dec 13, 2011
  3. 2/6 add_extra_ref(): remove flag argumentmhagger@alum.mit.edu, Dec 13, 2011
  4. 3/6 Extract a function do_for_each_extra_ref()mhagger@alum.mit.edu, Dec 13, 2011
  5. 4/6 Store extra_refs in a separate data structuremhagger@alum.mit.edu, Dec 13, 2011
  6. 5/6 Omit extra_refs except when iterating using for_each_ref()mhagger@alum.mit.edu, Dec 13, 2011
  7. 6/6 do_for_each_extra_ref(): simplify signaturemhagger@alum.mit.edu, Dec 13, 2011

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.