diff options
author | Miklos Vajna <vmiklos@frugalware.org> | 2008-10-26 03:33:57 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-10-26 14:43:26 -0700 |
commit | 450d4c0f5a966b3f5835107ec4d8c344c8c25908 (patch) | |
tree | f442e4f906b7b40fe8d19083471cac23539d1c69 | |
parent | eca35a25a92a1ad725af2a549fc9158488c4cc43 (diff) | |
download | git-450d4c0f5a966b3f5835107ec4d8c344c8c25908.tar.gz git-450d4c0f5a966b3f5835107ec4d8c344c8c25908.tar.xz |
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>
-rw-r--r-- | refs.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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); |