Skip to contentSkip to conversation

lock_any_ref_for_update(): clarify switch case statement

PATCH In review Michael Schubert 2 participants 2 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lock_any_ref_for_update(): clarify switch case statement

Write CHECK_REF_FORMAT_OK instead of '0' to be more verbose.

---
 refs.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
refs.c +1 -1
index e3c0511..67d6bbd 100644
@@ -1092,7 +1092,7 @@ struct ref_lock *lock_any_ref_for_update(const char *ref, const unsigned char *o
 	switch (check_ref_format(ref)) {
 	default:
 		return NULL;
-	case 0:
+	case CHECK_REF_FORMAT_OK:
 	case CHECK_REF_FORMAT_ONELEVEL:
 		return lock_ref_sha1_basic(ref, old_sha1, flags, NULL);
 	}
Signature · 1 line
1.7.5.1
#1 lore raw
Quoted 1 line · Michael Schubert

Write CHECK_REF_FORMAT_OK instead of '0' to be more verbose.

It is not wrong per-se to spell it out to be more descriptive, but I would think 0 is clear enough that there is no error.

In any case, being verbose is never a goal ;-).