From: Miklos Vajna Date: Sun, 26 Oct 2008 02:33:57 +0000 (+0100) Subject: rename_ref(): handle the case when the reflog of a ref does not exist X-Git-Tag: v1.6.0.4~5^2~3 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=450d4c0f5a966b3f5835107ec4d8c344c8c25908;p=git.git rename_ref(): handle the case when the reflog of a ref does not exist We tried to check if a reflog of a ref is a symlink without first checking if it exists, which is a bug. Signed-off-by: Miklos Vajna Signed-off-by: Junio C Hamano --- diff --git a/refs.c b/refs.c index b92930175..b39e6f2c2 100644 --- a/refs.c +++ b/refs.c @@ -966,7 +966,7 @@ int rename_ref(const char *oldref, const char *newref, const char *logmsg) const char *symref = NULL; int is_symref = 0; - if (S_ISLNK(loginfo.st_mode)) + if (log && S_ISLNK(loginfo.st_mode)) return error("reflog for %s is a symlink", oldref); symref = resolve_ref(oldref, orig_sha1, 1, &flag);