diff options
author | Michael Haggerty <mhagger@alum.mit.edu> | 2015-06-22 16:02:52 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-06-22 22:17:08 +0200 |
commit | fc1c21689d6d82551f6136a3116876005b4e00a4 (patch) | |
tree | 44bbe126fb0c3835bd4d6e71726cfcec5ae40bca /refs.c | |
parent | Second half of seventh batch (diff) | |
download | git-fc1c21689d6d82551f6136a3116876005b4e00a4.tar.xz git-fc1c21689d6d82551f6136a3116876005b4e00a4.zip |
delete_ref(): move declaration to refs.h
Also
* Add a docstring
* Rename the second parameter to "old_sha1", to be consistent with the
convention used elsewhere in the refs module
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'refs.c')
-rw-r--r-- | refs.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -2801,7 +2801,8 @@ static int delete_ref_loose(struct ref_lock *lock, int flag, struct strbuf *err) return 0; } -int delete_ref(const char *refname, const unsigned char *sha1, unsigned int flags) +int delete_ref(const char *refname, const unsigned char *old_sha1, + unsigned int flags) { struct ref_transaction *transaction; struct strbuf err = STRBUF_INIT; @@ -2809,7 +2810,7 @@ int delete_ref(const char *refname, const unsigned char *sha1, unsigned int flag transaction = ref_transaction_begin(&err); if (!transaction || ref_transaction_delete(transaction, refname, - (sha1 && !is_null_sha1(sha1)) ? sha1 : NULL, + (old_sha1 && !is_null_sha1(old_sha1)) ? old_sha1 : NULL, flags, NULL, &err) || ref_transaction_commit(transaction, &err)) { error("%s", err.buf); |