summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2021-05-16 11:11:56 +0100
committerEdward Thomson <ethomson@edwardthomson.com>2021-05-16 11:11:56 +0100
commit589443883bfb450fb2d04f50df8854d18bf9d176 (patch)
treefcd8d5479bb233296133e598b77fc15e5295a67b /src
parentbe95f684da5d05e59919448c1061febbd4ff6eb8 (diff)
parentcf323cb9d94022e0301b5bb3bebdf2f6a5b4e338 (diff)
downloadlibgit2-589443883bfb450fb2d04f50df8854d18bf9d176.tar.gz
Merge branch 'zero_oid_in_old'
Manually merging #5842
Diffstat (limited to 'src')
-rw-r--r--src/refdb_fs.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/refdb_fs.c b/src/refdb_fs.c
index ad8068ed6..0b8e103c2 100644
--- a/src/refdb_fs.c
+++ b/src/refdb_fs.c
@@ -1173,8 +1173,11 @@ static int cmp_old_ref(int *cmp, git_refdb_backend *backend, const char *name,
if (!old_id && !old_target)
return 0;
- if ((error = refdb_fs_backend__lookup(&old_ref, backend, name)) < 0)
+ if ((error = refdb_fs_backend__lookup(&old_ref, backend, name)) < 0) {
+ if (error == GIT_ENOTFOUND && old_id && git_oid_is_zero(old_id))
+ return 0;
goto out;
+ }
/* If the types don't match, there's no way the values do */
if (old_id && old_ref->type != GIT_REFERENCE_DIRECT) {