summaryrefslogtreecommitdiff
path: root/refs.h
diff options
context:
space:
mode:
authorRonnie Sahlberg <sahlberg@google.com>2014-06-20 07:42:44 -0700
committerJunio C Hamano <gitster@pobox.com>2014-07-14 11:54:40 -0700
commitf1c9350ad784eca97184b73973fad353baa99a1d (patch)
tree17a7432e66a56d24eaf749cbcbd72cac0cf10945 /refs.h
parent33f9fc593247322ddea5515f548a06cf34d12c2f (diff)
downloadgit-f1c9350ad784eca97184b73973fad353baa99a1d.tar.gz
refs.c: constify the sha arguments for ref_transaction_create|delete|update
ref_transaction_create|delete|update has no need to modify the sha1 arguments passed to it so it should use const unsigned char* instead of unsigned char*. Some functions, such as fast_forward_to(), already have its old/new sha1 arguments as consts. This function will at some point need to use ref_transaction_update() in which case this change is required. Reviewed-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Ronnie Sahlberg <sahlberg@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com> Acked-by: Michael Haggerty <mhagger@alum.mit.edu>
Diffstat (limited to 'refs.h')
-rw-r--r--refs.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/refs.h b/refs.h
index 7d946f6b8b..8c7f9c44dc 100644
--- a/refs.h
+++ b/refs.h
@@ -240,7 +240,8 @@ struct ref_transaction *ref_transaction_begin(void);
*/
void ref_transaction_update(struct ref_transaction *transaction,
const char *refname,
- unsigned char *new_sha1, unsigned char *old_sha1,
+ const unsigned char *new_sha1,
+ const unsigned char *old_sha1,
int flags, int have_old);
/*
@@ -251,7 +252,7 @@ void ref_transaction_update(struct ref_transaction *transaction,
*/
void ref_transaction_create(struct ref_transaction *transaction,
const char *refname,
- unsigned char *new_sha1,
+ const unsigned char *new_sha1,
int flags);
/*
@@ -261,7 +262,7 @@ void ref_transaction_create(struct ref_transaction *transaction,
*/
void ref_transaction_delete(struct ref_transaction *transaction,
const char *refname,
- unsigned char *old_sha1,
+ const unsigned char *old_sha1,
int flags, int have_old);
/*