git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] lock_any_ref_for_update(): clarify switch case statement

From
MSMichael Schubert <mschub@elegosoft.com>
Date
May 10, 2011, 11:48 UTC
Message-ID
<4DC925F1.4060307@elegosoft.com>
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
Next: Junio C Hamano
Message 1 of 2 in “lock_any_ref_for_update(): clarify switch case statement”
  1. lock_any_ref_for_update(): clarify switch case statementMichael Schubert, May 10, 2011
  2. Junio C HamanoMay 10, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.