diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2013-12-18 21:53:53 +0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-12-18 10:07:15 -0800 |
commit | 76d7968d381413343f25b5e4506803143de1b552 (patch) | |
tree | 4c7a4c4bcff2f6cb847cc7d21259b4a9c512b988 | |
parent | 3aa3fda184c9004833234f25f1d2201fee743bc3 (diff) | |
download | git-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.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -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)) { |