git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, Daniel Barkalow <barkalow@iabervon.org>
Subject: [PATCH 1/2] make "find_ref_by_name" a public function
Date: Sun, 18 Nov 2007 02:13:10 -0500	[thread overview]
Message-ID: <20071118071308.GA18467@sigill.intra.peff.net> (raw)
In-Reply-To: <20071118055804.GA19313@sigill.intra.peff.net>

This was a static in remote.c, but is generally useful.

Signed-off-by: Jeff King <peff@peff.net>
---
 cache.h  |    2 ++
 refs.c   |    8 ++++++++
 remote.c |    8 --------
 3 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/cache.h b/cache.h
index ba9178f..1f3f113 100644
--- a/cache.h
+++ b/cache.h
@@ -521,6 +521,8 @@ struct ref {
 #define REF_HEADS	(1u << 1)
 #define REF_TAGS	(1u << 2)
 
+extern struct ref *find_ref_by_name(struct ref *list, const char *name);
+
 #define CONNECT_VERBOSE       (1u << 0)
 extern struct child_process *git_connect(int fd[2], const char *url, const char *prog, int flags);
 extern int finish_connect(struct child_process *conn);
diff --git a/refs.c b/refs.c
index ae53254..54ec98d 100644
--- a/refs.c
+++ b/refs.c
@@ -1433,3 +1433,11 @@ int update_ref(const char *action, const char *refname,
 	}
 	return 0;
 }
+
+struct ref *find_ref_by_name(struct ref *list, const char *name)
+{
+	for ( ; list; list = list->next)
+		if (!strcmp(list->name, name))
+			return list;
+	return NULL;
+}
diff --git a/remote.c b/remote.c
index 09b7aad..bb01059 100644
--- a/remote.c
+++ b/remote.c
@@ -696,14 +696,6 @@ static int match_explicit_refs(struct ref *src, struct ref *dst,
 	return -errs;
 }
 
-static struct ref *find_ref_by_name(struct ref *list, const char *name)
-{
-	for ( ; list; list = list->next)
-		if (!strcmp(list->name, name))
-			return list;
-	return NULL;
-}
-
 static const struct refspec *check_pattern_match(const struct refspec *rs,
 						 int rs_nr,
 						 const struct ref *src)
-- 
1.5.3.5.1817.g37c1a-dirty

  parent reply	other threads:[~2007-11-18  7:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-18  5:58 [PATCH] send-pack: improve error reporting for total remote unpack Jeff King
2007-11-18  5:59 ` Jeff King
2007-11-18  7:09 ` Jeff King
2007-11-18  7:13 ` Jeff King [this message]
2007-11-18  7:16 ` [PATCH 2/2] send-pack: tighten remote error reporting Jeff King
2007-11-18  7:59   ` Jeff King
2007-11-18  8:08 ` [PATCH 3/2] send-pack: fix "everything up-to-date" message Jeff King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071118071308.GA18467@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=barkalow@iabervon.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).