Error messages for a couple other boundary conditions

This commit is contained in:
Russell Belfer 2013-05-01 15:08:12 -07:00
parent 62caf3f38f
commit 41e93563e7
2 changed files with 6 additions and 2 deletions

View File

@ -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);

View File

@ -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);