From e711b1af2ead2ffad5c510aadbbc387c7d8aa4c7 Mon Sep 17 00:00:00 2001 From: Michael Haggerty Date: Thu, 21 Apr 2016 23:42:19 +0200 Subject: rename_ref(): remove unneeded local variable Signed-off-by: Michael Haggerty --- refs/files-backend.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'refs') diff --git a/refs/files-backend.c b/refs/files-backend.c index 2d3a8c669..80d346fd3 100644 --- a/refs/files-backend.c +++ b/refs/files-backend.c @@ -2360,20 +2360,17 @@ int rename_ref(const char *oldrefname, const char *newrefname, const char *logms struct ref_lock *lock; struct stat loginfo; int log = !lstat(git_path("logs/%s", oldrefname), &loginfo); - const char *symref = NULL; struct strbuf err = STRBUF_INIT; if (log && S_ISLNK(loginfo.st_mode)) return error("reflog for %s is a symlink", oldrefname); - symref = resolve_ref_unsafe(oldrefname, RESOLVE_REF_READING, - orig_sha1, &flag); + if (!resolve_ref_unsafe(oldrefname, RESOLVE_REF_READING, orig_sha1, &flag)) + return error("refname %s not found", oldrefname); + if (flag & REF_ISSYMREF) return error("refname %s is a symbolic ref, renaming it is not supported", oldrefname); - if (!symref) - return error("refname %s not found", oldrefname); - if (!rename_ref_available(oldrefname, newrefname)) return 1; -- cgit v1.2.1