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:
authorBen Straub <bs@github.com>2013-10-28 17:20:28 +0400
committerBen Straub <bs@github.com>2013-10-28 17:20:28 +0400
commit8f4a8b096ba35a2af3f9c51dad7e0402790b58ac (patch)
tree80a707dd35672be1f88506c04058b7fad9947fa6 /src/stash.c
parenta1efa5960d8f874b92403d875bf08a22c7be2437 (diff)
parent0174794a955dbec1e2d9ecf581833fc23c7e844c (diff)
Merge pull request #1802 from libgit2/cmn/reflog-backend
Make reflog part of refdb
Diffstat (limited to 'src/stash.c')
-rw-r--r--src/stash.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/stash.c b/src/stash.c
index 6fa74ac0a..083c2a4cd 100644
--- a/src/stash.c
+++ b/src/stash.c
@@ -411,14 +411,16 @@ static int update_reflog(
const git_signature *stasher,
const char *message)
{
- git_reference *stash = NULL;
+ git_reference *stash;
git_reflog *reflog = NULL;
int error;
if ((error = git_reference_create(&stash, repo, GIT_REFS_STASH_FILE, w_commit_oid, 1)) < 0)
goto cleanup;
- if ((error = git_reflog_read(&reflog, stash)) < 0)
+ git_reference_free(stash);
+
+ if ((error = git_reflog_read(&reflog, repo, GIT_REFS_STASH_FILE) < 0))
goto cleanup;
if ((error = git_reflog_append(reflog, w_commit_oid, stasher, message)) < 0)
@@ -428,7 +430,6 @@ static int update_reflog(
goto cleanup;
cleanup:
- git_reference_free(stash);
git_reflog_free(reflog);
return error;
}
@@ -574,7 +575,7 @@ int git_stash_foreach(
if (error < 0)
goto cleanup;
- if ((error = git_reflog_read(&reflog, stash)) < 0)
+ if ((error = git_reflog_read(&reflog, repo, GIT_REFS_STASH_FILE)) < 0)
goto cleanup;
max = git_reflog_entrycount(reflog);
@@ -608,7 +609,7 @@ int git_stash_drop(
if ((error = git_reference_lookup(&stash, repo, GIT_REFS_STASH_FILE)) < 0)
return error;
- if ((error = git_reflog_read(&reflog, stash)) < 0)
+ if ((error = git_reflog_read(&reflog, repo, GIT_REFS_STASH_FILE)) < 0)
goto cleanup;
max = git_reflog_entrycount(reflog);