summaryrefslogtreecommitdiff
path: root/src/stash.c
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2013-05-01 15:51:30 -0700
committerRussell Belfer <rb@github.com>2013-05-01 15:51:30 -0700
commit52c52737353a7ee7b653ab314d7b89ca6ddafe63 (patch)
tree5cf3c6e181c304e38b7f11324c7f3756683158d0 /src/stash.c
parentf470b00b037cfcd40e19e88913a9a8b64d98288f (diff)
downloadlibgit2-52c52737353a7ee7b653ab314d7b89ca6ddafe63.tar.gz
Clear error msg when we eat error silently
Diffstat (limited to 'src/stash.c')
-rw-r--r--src/stash.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/stash.c b/src/stash.c
index 355c5dc9c..19b29be77 100644
--- a/src/stash.c
+++ b/src/stash.c
@@ -587,8 +587,10 @@ int git_stash_foreach(
const git_reflog_entry *entry;
error = git_reference_lookup(&stash, repo, GIT_REFS_STASH_FILE);
- if (error == GIT_ENOTFOUND)
+ if (error == GIT_ENOTFOUND) {
+ giterr_clear();
return 0;
+ }
if (error < 0)
goto cleanup;
@@ -651,7 +653,7 @@ int git_stash_drop(
const git_reflog_entry *entry;
entry = git_reflog_entry_byindex(reflog, 0);
-
+
git_reference_free(stash);
error = git_reference_create(&stash, repo, GIT_REFS_STASH_FILE, &entry->oid_cur, 1);
}