Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornulltoken <emeric.fermas@gmail.com>2013-02-22 18:25:06 +0400
committernulltoken <emeric.fermas@gmail.com>2013-02-22 18:25:59 +0400
commit9ccab8dfb86bb75c8810ad490b3713c0fa052b01 (patch)
tree0b451d0c161e327ce79d9d06125dde540ef9c688 /src/stash.c
parent39bcb4deb816573b8f68154f90288ad1e21e1520 (diff)
stash: Update the reference when dropping the topmost stash
Diffstat (limited to 'src/stash.c')
-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: