git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Rewritten fetch-pack.c:filter_refs() using starts_with() instead of memcmp()
@ 2014-03-20 10:04 MustafaOrkunAcar
  2014-03-21  6:27 ` Eric Sunshine
  0 siblings, 1 reply; 2+ messages in thread
From: MustafaOrkunAcar @ 2014-03-20 10:04 UTC (permalink / raw)
  To: git; +Cc: MustafaOrkunAcar

Hi, I have completed one of the microprojects -14th one: "Change fetch-pack.c:filter_refs() to use starts_with() instead of memcmp()." The only line in the function filter_refs() containing memcmp() is changed with starts_with(). I plan to apply for GSoC 2014. Any feedback is appreciated. Thanks. 
Signed-off-by: MustafaOrkunAcar <mustafaorkunacar@gmail.com>
---
 fetch-pack.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fetch-pack.c b/fetch-pack.c
index f061f1f..17823ab 100644
--- a/fetch-pack.c
+++ b/fetch-pack.c
@@ -506,7 +506,7 @@ static void filter_refs(struct fetch_pack_args *args,
 		int keep = 0;
 		next = ref->next;
 
-		if (!memcmp(ref->name, "refs/", 5) &&
+		if (starts_with(ref->name, "refs/") &&
 		    check_refname_format(ref->name, 0))
 			; /* trash */
 		else {
-- 
1.9.1.286.g5172cb3

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-03-21  6:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-20 10:04 [PATCH] Rewritten fetch-pack.c:filter_refs() using starts_with() instead of memcmp() MustafaOrkunAcar
2014-03-21  6:27 ` Eric Sunshine

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).