summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMiguel Arroz <750683+arroz@users.noreply.github.com>2022-11-03 11:26:30 -0700
committerMiguel Arroz <750683+arroz@users.noreply.github.com>2022-11-03 11:26:30 -0700
commitb57221e82919b798983ea0d3c3fd1a5de9170809 (patch)
tree187ec0de5b5a41ec73b2ccd9c011f750e5aad8b5 /src
parenta3841af5eecc6301e87f8302c7fdce6555e39247 (diff)
downloadlibgit2-b57221e82919b798983ea0d3c3fd1a5de9170809.tar.gz
#6422: handle dangling symbolic refs gracefully
Diffstat (limited to 'src')
-rw-r--r--src/libgit2/revwalk.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/libgit2/revwalk.c b/src/libgit2/revwalk.c
index 553e0497a..3269d9279 100644
--- a/src/libgit2/revwalk.c
+++ b/src/libgit2/revwalk.c
@@ -121,8 +121,12 @@ int git_revwalk__push_ref(git_revwalk *walk, const char *refname, const git_revw
{
git_oid oid;
- if (git_reference_name_to_id(&oid, walk->repo, refname) < 0)
+ int error = git_reference_name_to_id(&oid, walk->repo, refname);
+ if (opts->from_glob && (error == GIT_ENOTFOUND || error == GIT_EINVALIDSPEC || error == GIT_EPEEL)) {
+ return 0;
+ } else if (error < 0) {
return -1;
+ }
return git_revwalk__push_commit(walk, &oid, opts);
}