summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2013-12-18 21:53:53 +0700
committerJunio C Hamano <gitster@pobox.com>2013-12-18 10:07:15 -0800
commit76d7968d381413343f25b5e4506803143de1b552 (patch)
tree4c7a4c4bcff2f6cb847cc7d21259b4a9c512b988
parent3aa3fda184c9004833234f25f1d2201fee743bc3 (diff)
downloadgit-76d7968d381413343f25b5e4506803143de1b552.tar.gz
refs.c: replace some use of starts_with() with skip_prefix()
It's out of context, but there are neither changes in buffer nor buf between two chunks. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--refs.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/refs.c b/refs.c
index 5e378bc74d..1fb658f6ab 100644
--- a/refs.c
+++ b/refs.c
@@ -1339,7 +1339,7 @@ const char *resolve_ref_unsafe(const char *refname, unsigned char *sha1, int rea
for (;;) {
char path[PATH_MAX];
struct stat st;
- char *buf;
+ const char *buf;
int fd;
if (--depth < 0)
@@ -1415,7 +1415,7 @@ const char *resolve_ref_unsafe(const char *refname, unsigned char *sha1, int rea
/*
* Is it a symbolic ref?
*/
- if (!starts_with(buffer, "ref:")) {
+ if ((buf = skip_prefix(buffer, "ref:")) == NULL) {
/*
* Please note that FETCH_HEAD has a second
* line containing other data.
@@ -1430,7 +1430,6 @@ const char *resolve_ref_unsafe(const char *refname, unsigned char *sha1, int rea
}
if (flag)
*flag |= REF_ISSYMREF;
- buf = buffer + 4;
while (isspace(*buf))
buf++;
if (check_refname_format(buf, REFNAME_ALLOW_ONELEVEL)) {