summaryrefslogtreecommitdiff
path: root/refs
diff options
context:
space:
mode:
authorMichael Haggerty <mhagger@alum.mit.edu>2016-04-07 15:02:58 -0400
committerJunio C Hamano <gitster@pobox.com>2016-04-10 11:35:19 -0700
commit90c28ae11c5a9d8386606c727be1d80699c9aa92 (patch)
tree5d6534b022a98cb529b59bfab8bed870aa9295c8 /refs
parenta70a93b7947d3aa6a202342256e616460a2b6e5b (diff)
downloadgit-90c28ae11c5a9d8386606c727be1d80699c9aa92.tar.gz
resolve_ref_1(): eliminate local variable
In place of `buf`, use `refname`, which is anyway a better description of what is being pointed at. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: David Turner <dturner@twopensource.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'refs')
-rw-r--r--refs/files-backend.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/refs/files-backend.c b/refs/files-backend.c
index 067ce1c39e..69ec9036e0 100644
--- a/refs/files-backend.c
+++ b/refs/files-backend.c
@@ -1426,7 +1426,6 @@ static const char *resolve_ref_1(const char *refname,
for (symref_count = 0; symref_count < MAXDEPTH; symref_count++) {
const char *path;
struct stat st;
- char *buf;
int fd;
strbuf_reset(sb_path);
@@ -1532,21 +1531,21 @@ static const char *resolve_ref_1(const char *refname,
return refname;
}
*flags |= REF_ISSYMREF;
- buf = sb_contents->buf + 4;
- while (isspace(*buf))
- buf++;
+ refname = sb_contents->buf + 4;
+ while (isspace(*refname))
+ refname++;
strbuf_reset(sb_refname);
- strbuf_addstr(sb_refname, buf);
+ strbuf_addstr(sb_refname, refname);
refname = sb_refname->buf;
if (resolve_flags & RESOLVE_REF_NO_RECURSE) {
hashclr(sha1);
return refname;
}
- if (check_refname_format(buf, REFNAME_ALLOW_ONELEVEL)) {
+ if (check_refname_format(refname, REFNAME_ALLOW_ONELEVEL)) {
*flags |= REF_ISBROKEN;
if (!(resolve_flags & RESOLVE_REF_ALLOW_BAD_NAME) ||
- !refname_is_safe(buf)) {
+ !refname_is_safe(refname)) {
errno = EINVAL;
return NULL;
}