struct ref_update: rename field "ref_name" to "refname"

This is consistent with the usual nomenclature. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Michael Haggerty committed Apr 7, 2014 at 15:48 UTC 5524e2416ec97f8c6d1a2fc12ee857efa9641175
2 files changed +10 -10
refs.c
+9 -9
@@ -3274,7 +3274,7 @@ static int update_ref_write(const char *action, const char *refname,
3274 * value or to zero to ensure the ref does not exist before update.
3275 */
3276 struct ref_update {
3277 - const char *ref_name;
3277 + const char *refname;
3278 unsigned char new_sha1[20];
3279 unsigned char old_sha1[20];
3280 int flags; /* REF_NODEREF? */
@@ -3304,7 +3304,7 @@ static void ref_transaction_free(struct ref_transaction *transaction)
3304 for (i = 0; i < transaction->nr; i++) {
3305 struct ref_update *update = transaction->updates[i];
3306
3307 - free((char *)update->ref_name);
3307 + free((char *)update->refname);
3308 free(update);
3309 }
3310
@@ -3322,7 +3322,7 @@ static struct ref_update *add_update(struct ref_transaction *transaction,
3322 {
3323 struct ref_update *update = xcalloc(1, sizeof(*update));
3324
3325 - update->ref_name = xstrdup(refname);
3325 + update->refname = xstrdup(refname);
3326 ALLOC_GROW(transaction->updates, transaction->nr + 1, transaction->alloc);
3327 transaction->updates[transaction->nr++] = update;
3328 return update;
@@ -3386,7 +3386,7 @@ static int ref_update_compare(const void *r1, const void *r2)
3386 {
3387 const struct ref_update * const *u1 = r1;
3388 const struct ref_update * const *u2 = r2;
3389 - return strcmp((*u1)->ref_name, (*u2)->ref_name);
3389 + return strcmp((*u1)->refname, (*u2)->refname);
3390 }
3391
3392 static int ref_update_reject_duplicates(struct ref_update **updates, int n,
@@ -3394,14 +3394,14 @@ static int ref_update_reject_duplicates(struct ref_update **updates, int n,
3394 {
3395 int i;
3396 for (i = 1; i < n; i++)
3397 - if (!strcmp(updates[i - 1]->ref_name, updates[i]->ref_name)) {
3397 + if (!strcmp(updates[i - 1]->refname, updates[i]->refname)) {
3398 const char *str =
3399 "Multiple updates for ref '%s' not allowed.";
3400 switch (onerr) {
3401 case UPDATE_REFS_MSG_ON_ERR:
3402 - error(str, updates[i]->ref_name); break;
3402 + error(str, updates[i]->refname); break;
3403 case UPDATE_REFS_DIE_ON_ERR:
3404 - die(str, updates[i]->ref_name); break;
3404 + die(str, updates[i]->refname); break;
3405 case UPDATE_REFS_QUIET_ON_ERR:
3406 break;
3407 }
@@ -3438,7 +3438,7 @@ int ref_transaction_commit(struct ref_transaction *transaction,
3438
3439 /* Acquire all locks while verifying old values */
3440 for (i = 0; i < n; i++) {
3441 - locks[i] = update_ref_lock(updates[i]->ref_name,
3441 + locks[i] = update_ref_lock(updates[i]->refname,
3442 (updates[i]->have_old ?
3443 updates[i]->old_sha1 : NULL),
3444 updates[i]->flags,
@@ -3453,7 +3453,7 @@ int ref_transaction_commit(struct ref_transaction *transaction,
3453 for (i = 0; i < n; i++)
3454 if (!is_null_sha1(updates[i]->new_sha1)) {
3455 ret = update_ref_write(msg,
3456 - updates[i]->ref_name,
3456 + updates[i]->refname,
3457 updates[i]->new_sha1,
3458 locks[i], onerr);
3459 locks[i] = NULL; /* freed by update_ref_write */
refs.h
+1 -1
@@ -154,7 +154,7 @@ extern void unlock_ref(struct ref_lock *lock);
154 extern int write_ref_sha1(struct ref_lock *lock, const unsigned char *sha1, const char *msg);
155
156 /** Setup reflog before using. **/
157 -int log_ref_setup(const char *ref_name, char *logfile, int bufsize);
157 +int log_ref_setup(const char *refname, char *logfile, int bufsize);
158
159 /** Reads log for the value of ref during at_time. **/
160 extern int read_ref_at(const char *refname, unsigned long at_time, int cnt,