Skip to content

Commit

Permalink
rename_ref(): handle the case when the reflog of a ref does not exist
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Miklos Vajna authored and Junio C Hamano committed Oct 26, 2008
1 parent eca35a2 commit 450d4c0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion refs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 450d4c0

Please sign in to comment.