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>2012-07-04 14:20:43 +0400
committernulltoken <emeric.fermas@gmail.com>2012-07-07 14:15:29 +0400
commit33c3370700083b9138b167778814d5af06ccf0b4 (patch)
tree31523a72aac618eeca6a9d963944742aef095eea /src/refs.c
parent75261421ec00b6dc0a72931ed7640743a4998c7d (diff)
refs: deploy git_reference_has_log()
Diffstat (limited to 'src/refs.c')
-rw-r--r--src/refs.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/refs.c b/src/refs.c
index 2aba83ef5..fbbb86689 100644
--- a/src/refs.c
+++ b/src/refs.c
@@ -1404,18 +1404,12 @@ int git_reference_rename(git_reference *ref, const char *new_name, int force)
}
/*
- * Rename the reflog file.
+ * Rename the reflog file, if it exists.
*/
- git_buf_clear(&aux_path);
- if (git_buf_join_n(&aux_path, '/', 3, ref->owner->path_repository, GIT_REFLOG_DIR, ref->name) < 0)
+ if ((git_reference_has_log(ref)) && (git_reflog_rename(ref, new_name) < 0))
goto cleanup;
- if (git_path_exists(aux_path.ptr) == true) {
- if (git_reflog_rename(ref, new_name) < 0)
- goto cleanup;
- } else {
- giterr_clear();
- }
+ giterr_clear();
/*
* Change the name of the reference given by the user.