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:
authorEdward Thomson <ethomson@edwardthomson.com>2013-03-02 01:37:33 +0400
committerEdward Thomson <ethomson@edwardthomson.com>2013-03-07 21:01:52 +0400
commitd00d54645d931c77a9b401518c0d73e3f640454b (patch)
treee1932dcc97172a53524e9db1ba4923cf137a4f9c /src/stash.c
parent6a9ef012376e8a21dcfd0499ab16048eb6e954c3 (diff)
immutable references and a pluggable ref database
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 e78985063..355c5dc9c 100644
--- a/src/stash.c
+++ b/src/stash.c
@@ -645,13 +645,15 @@ int git_stash_drop(
if (max == 1) {
error = git_reference_delete(stash);
+ git_reference_free(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);
+
+ git_reference_free(stash);
+ error = git_reference_create(&stash, repo, GIT_REFS_STASH_FILE, &entry->oid_cur, 1);
}
cleanup: