git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] lock_any_ref_for_update(): clarify switch case statement
@ 2011-05-10 11:48 Michael Schubert
  2011-05-10 20:07 ` Junio C Hamano
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Schubert @ 2011-05-10 11:48 UTC (permalink / raw)
  To: git


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

Signed-off-by: Michael Schubert <mschub@elegosoft.com>
---
 refs.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/refs.c b/refs.c
index e3c0511..67d6bbd 100644
--- a/refs.c
+++ b/refs.c
@@ -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);
 	}
-- 
1.7.5.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] lock_any_ref_for_update(): clarify switch case statement
  2011-05-10 11:48 [PATCH] lock_any_ref_for_update(): clarify switch case statement Michael Schubert
@ 2011-05-10 20:07 ` Junio C Hamano
  0 siblings, 0 replies; 2+ messages in thread
From: Junio C Hamano @ 2011-05-10 20:07 UTC (permalink / raw)
  To: Michael Schubert; +Cc: git

Michael Schubert <mschub@elegosoft.com> writes:

> 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 ;-).

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-05-10 20:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-10 11:48 [PATCH] lock_any_ref_for_update(): clarify switch case statement Michael Schubert
2011-05-10 20:07 ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).