diff options
author | Carlos Rica <jasampler@gmail.com> | 2007-09-05 03:38:24 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2007-09-05 11:29:33 -0700 |
commit | 3d9f037c60ceae1bd60ee3c861564812a89b05b1 (patch) | |
tree | 6bf932b630728e2313ffacd8ef573eb63fdc383e /refs.h | |
parent | 1e61b7640d09015213dbcae3564fa27ac6a8c151 (diff) | |
download | git-3d9f037c60ceae1bd60ee3c861564812a89b05b1.tar.gz |
Function for updating refs.
A function intended to be called from builtins updating refs
by locking them before write, specially those that came from
scripts using "git update-ref".
[jc: with minor fixups]
Signed-off-by: Carlos Rica <jasampler@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'refs.h')
-rw-r--r-- | refs.h | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -64,4 +64,10 @@ extern int rename_ref(const char *oldref, const char *newref, const char *logmsg /** resolve ref in nested "gitlink" repository */ extern int resolve_gitlink_ref(const char *name, const char *refname, unsigned char *result); +/** lock a ref and then write its file */ +enum action_on_err { MSG_ON_ERR, DIE_ON_ERR, QUIET_ON_ERR }; +int update_ref(const char *action, const char *refname, + const unsigned char *sha1, const unsigned char *oldval, + int flags, enum action_on_err onerr); + #endif /* REFS_H */ |