refs.c: constify the sha arguments for ref_transaction_create|delete|update
[gitweb.git] / refs.c
diff --git a/refs.c b/refs.c
index 6d841a06458f45b5e88950cfca3de02f98ebf4da..21ed46534ab81aa966860a8eaad6e499d9e2b2c3 100644 (file)
--- a/refs.c
+++ b/refs.c
@@ -3359,7 +3359,8 @@ static struct ref_update *add_update(struct ref_transaction *transaction,
 
 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)
 {
        struct ref_update *update = add_update(transaction, refname);
@@ -3373,7 +3374,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)
 {
        struct ref_update *update = add_update(transaction, refname);
@@ -3387,7 +3388,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)
 {
        struct ref_update *update = add_update(transaction, refname);
@@ -3509,7 +3510,6 @@ int ref_transaction_commit(struct ref_transaction *transaction,
                if (updates[i]->lock)
                        unlock_ref(updates[i]->lock);
        free(delnames);
-       ref_transaction_free(transaction);
        return ret;
 }