1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-10-28 12:59:41 +01:00

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 <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Miklos Vajna 2008-10-26 03:33:57 +01:00 committed by Junio C Hamano
parent eca35a25a9
commit 450d4c0f5a

2
refs.c
View file

@ -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);