mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-19 18:39:26 +00:00
Check for errors when dereferencing symbolic refs
This commit is contained in:
parent
ee8e6afda9
commit
7f058b8668
@ -1452,8 +1452,12 @@ static int reflog_append(refdb_fs_backend *backend, const git_reference *ref, co
|
|||||||
if (error < 0)
|
if (error < 0)
|
||||||
return error;
|
return error;
|
||||||
|
|
||||||
if (git_reference_symbolic_target(ref) != NULL)
|
if (git_reference_symbolic_target(ref) != NULL) {
|
||||||
git_reference_name_to_id(&new_id, repo, git_reference_symbolic_target(ref));
|
error = git_reference_name_to_id(&new_id, repo, git_reference_symbolic_target(ref));
|
||||||
|
if (error != 0 && error != GIT_ENOTFOUND)
|
||||||
|
goto cleanup;
|
||||||
|
giterr_clear();
|
||||||
|
}
|
||||||
else if (git_reference_target(ref) != NULL)
|
else if (git_reference_target(ref) != NULL)
|
||||||
git_oid_cpy(&new_id, git_reference_target(ref));
|
git_oid_cpy(&new_id, git_reference_target(ref));
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user