Error messages for a couple other boundary conditions
diff --git a/src/reflog.c b/src/reflog.c
index 8c133fe..4cc20d2 100644
--- a/src/reflog.c
+++ b/src/reflog.c
@@ -483,8 +483,10 @@ int git_reflog_drop(
entry = (git_reflog_entry *)git_reflog_entry_byindex(reflog, idx);
- if (entry == NULL)
+ if (entry == NULL) {
+ giterr_set(GITERR_REFERENCE, "No reflog entry at index "PRIuZ, idx);
return GIT_ENOTFOUND;
+ }
reflog_entry_free(entry);
diff --git a/src/refs.c b/src/refs.c
index b85a2e8..8bba394 100644
--- a/src/refs.c
+++ b/src/refs.c
@@ -844,8 +844,10 @@ static int reference__update_terminal(
git_reference *ref;
int error = 0;
- if (nesting > MAX_NESTING_LEVEL)
+ if (nesting > MAX_NESTING_LEVEL) {
+ giterr_set(GITERR_REFERENCE, "Reference chain too deep (%d)", nesting);
return GIT_ENOTFOUND;
+ }
error = git_reference_lookup(&ref, repo, ref_name);