summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorVicent Martí <vicent@github.com>2013-02-22 09:48:34 -0800
committerVicent Martí <vicent@github.com>2013-02-22 09:48:34 -0800
commit698bf1da0e02ada06ded9277ce43f429ce789975 (patch)
tree0b451d0c161e327ce79d9d06125dde540ef9c688 /src
parent0309e85045bfb143c172b3342293d98d687e8092 (diff)
parent9ccab8dfb86bb75c8810ad490b3713c0fa052b01 (diff)
downloadlibgit2-698bf1da0e02ada06ded9277ce43f429ce789975.tar.gz
Merge pull request #1354 from nulltoken/fix/stash-drop
Fix git_stash_drop()
Diffstat (limited to 'src')
-rw-r--r--src/stash.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/stash.c b/src/stash.c
index 877af3312..e78985063 100644
--- a/src/stash.c
+++ b/src/stash.c
@@ -646,6 +646,12 @@ int git_stash_drop(
if (max == 1) {
error = git_reference_delete(stash);
stash = NULL;
+ } else if (index == 0) {
+ const git_reflog_entry *entry;
+
+ entry = git_reflog_entry_byindex(reflog, 0);
+
+ error = git_reference_set_target(stash, &entry->oid_cur);
}
cleanup: