summaryrefslogtreecommitdiff
path: root/include/git2/refs.h
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2013-11-23 14:13:01 +0100
committerCarlos Martín Nieto <cmn@dwim.me>2013-12-09 15:55:11 +0100
commit8d5ec9106afbca346a8def84ef20de0a7ba2240a (patch)
tree83dea84e33442fa8e4c58321a246b08b52c5fc0e /include/git2/refs.h
parent6f13a30565fc3891c0df161945097b316945fca7 (diff)
downloadlibgit2-8d5ec9106afbca346a8def84ef20de0a7ba2240a.tar.gz
refs: expose a way to ensure a ref has a log
Sometimes (e.g. stash) we want to make sure that a log will be written, even if it's not in one of the standard locations. Let's make that easier.
Diffstat (limited to 'include/git2/refs.h')
-rw-r--r--include/git2/refs.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/git2/refs.h b/include/git2/refs.h
index 2dc137692..31bf997fe 100644
--- a/include/git2/refs.h
+++ b/include/git2/refs.h
@@ -556,6 +556,18 @@ GIT_EXTERN(int) git_reference_foreach_glob(
GIT_EXTERN(int) git_reference_has_log(git_reference *ref);
/**
+ * Ensure there is a reflog for a particular reference.
+ *
+ * Make sure that successive updates to the reference will append to
+ * its log.
+ *
+ * @param repo the repository
+ * @param refname the reference's name
+ * @return 0 or an error code.
+ */
+GIT_EXTERN(int) git_reference_ensure_log(git_repository *repo, const char *refname);
+
+/**
* Check if a reference is a local branch.
*
* @param ref A git reference