summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2013-05-01 15:08:12 -0700
committerRussell Belfer <rb@github.com>2013-05-01 15:08:12 -0700
commit41e93563e7462bd37cf3a09b8aaac35736046482 (patch)
treec3d0a67ac9f3607a46147c94895247c655002306 /src
parent62caf3f38fa25537b5f824329d8f88875ee837f2 (diff)
downloadlibgit2-41e93563e7462bd37cf3a09b8aaac35736046482.tar.gz
Error messages for a couple other boundary conditions
Diffstat (limited to 'src')
-rw-r--r--src/reflog.c4
-rw-r--r--src/refs.c4
2 files changed, 6 insertions, 2 deletions
diff --git a/src/reflog.c b/src/reflog.c
index 8c133fe53..4cc20d2c7 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 b85a2e828..8bba3941e 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);