summaryrefslogtreecommitdiff
path: root/refs.h
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-08-03 11:01:29 -0700
committerJunio C Hamano <gitster@pobox.com>2015-08-03 11:01:29 -0700
commitb6d323f1646d7204fc6693071e5be84377ece70b (patch)
treebb917f3763b586c34dc8fb03fb4bc9c8132e4632 /refs.h
parent8348bf1b6957e8e75fbfc988ce4e7802ce408d6b (diff)
parent89dea973349769efa8facc6f7b11095958205d4d (diff)
downloadgit-b6d323f1646d7204fc6693071e5be84377ece70b.tar.gz
Merge branch 'dt/refs-backend-preamble'
In preparation for allowing different "backends" to store the refs in a way different from the traditional "one ref per file in $GIT_DIR or in a $GIT_DIR/packed-refs file" filesystem storage, reduce direct filesystem access to ref-like things like CHERRY_PICK_HEAD from scripts and programs. * dt/refs-backend-preamble: git-stash: use update-ref --create-reflog instead of creating files update-ref and tag: add --create-reflog arg refs: add REF_FORCE_CREATE_REFLOG flag git-reflog: add exists command refs: new public ref function: safe_create_reflog refs: break out check for reflog autocreation refs.c: add err arguments to reflog functions
Diffstat (limited to 'refs.h')
-rw-r--r--refs.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/refs.h b/refs.h
index e82fca51f5..e4e46c3dc4 100644
--- a/refs.h
+++ b/refs.h
@@ -224,11 +224,12 @@ int pack_refs(unsigned int flags);
* Other flags are reserved for internal use.
*/
#define REF_NODEREF 0x01
+#define REF_FORCE_CREATE_REFLOG 0x40
/*
- * Setup reflog before using. Set errno to something meaningful on failure.
+ * Setup reflog before using. Fill in err and return -1 on failure.
*/
-int log_ref_setup(const char *refname, struct strbuf *logfile);
+int safe_create_reflog(const char *refname, int force_create, struct strbuf *err);
/** Reads log for the value of ref during at_time. **/
extern int read_ref_at(const char *refname, unsigned int flags,