Skip to content

Commit

Permalink
Reflog: correct "new" id for reattaching HEAD
Browse files Browse the repository at this point in the history
  • Loading branch information
ben committed Feb 1, 2014
1 parent 7ac1b89 commit ee8e6af
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/refdb_fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1452,7 +1452,9 @@ static int reflog_append(refdb_fs_backend *backend, const git_reference *ref, co
if (error < 0)
return error;

if (git_reference_target(ref) != NULL)
if (git_reference_symbolic_target(ref) != NULL)
git_reference_name_to_id(&new_id, repo, git_reference_symbolic_target(ref));
else if (git_reference_target(ref) != NULL)
git_oid_cpy(&new_id, git_reference_target(ref));

if ((error = serialize_reflog_entry(&buf, &old_id, &new_id, who, message)) < 0)
Expand Down

0 comments on commit ee8e6af

Please sign in to comment.