Commit 41e93563 by Russell Belfer

Error messages for a couple other boundary conditions

parent 62caf3f3
...@@ -483,8 +483,10 @@ int git_reflog_drop( ...@@ -483,8 +483,10 @@ int git_reflog_drop(
entry = (git_reflog_entry *)git_reflog_entry_byindex(reflog, idx); 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; return GIT_ENOTFOUND;
}
reflog_entry_free(entry); reflog_entry_free(entry);
......
...@@ -844,8 +844,10 @@ static int reference__update_terminal( ...@@ -844,8 +844,10 @@ static int reference__update_terminal(
git_reference *ref; git_reference *ref;
int error = 0; 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; return GIT_ENOTFOUND;
}
error = git_reference_lookup(&ref, repo, ref_name); error = git_reference_lookup(&ref, repo, ref_name);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment