lock_any_ref_for_update(): clarify switch case statement
PATCH 1/1 lock_any_ref_for_update(): clarify switch case statement
Write CHECK_REF_FORMAT_OK instead of '0' to be more verbose.
Signed-off-by Michael Schubert <[email protected]>
--- refs.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
refs.c +1 -1
@@ -1092,7 +1092,7 @@ struct ref_lock *lock_any_ref_for_update(const char *ref, const unsigned char *oswitch (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
Quoted 1 line · Michael Schubert
Write
CHECK_REF_FORMAT_OKinstead 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 ;-).