git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH 2/3] Cleanup unnecessary break in remote.c
@ 2007-09-25  4:13 Shawn O. Pearce
  0 siblings, 0 replies; only message in thread
From: Shawn O. Pearce @ 2007-09-25  4:13 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

This simple change makes the body of "case 0" easier to read; no
matter what the value of matched_src is we want to break out of
the switch and not fall through.  We only want to display an error
if matched_src is NULL, as this indicates there is no local branch
matching the input.

Also modified the default case's error message so it uses one less
line of text.  Even at 8 column per tab indentation we still don't
break 80 columns with this new formatting.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
---
 remote.c |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/remote.c b/remote.c
index ac354f3..2166a2b 100644
--- a/remote.c
+++ b/remote.c
@@ -598,15 +598,12 @@ static int match_explicit(struct ref *src, struct ref *dst,
 		 * way to delete 'other' ref at the remote end.
 		 */
 		matched_src = try_explicit_object_name(rs->src);
-		if (matched_src)
-			break;
-		error("src refspec %s does not match any.",
-		      rs->src);
+		if (!matched_src)
+			error("src refspec %s does not match any.", rs->src);
 		break;
 	default:
 		matched_src = NULL;
-		error("src refspec %s matches more than one.",
-		      rs->src);
+		error("src refspec %s matches more than one.", rs->src);
 		break;
 	}
 
-- 
1.5.3.2.124.g2456-dirty

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2007-09-25  4:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-09-25  4:13 [PATCH 2/3] Cleanup unnecessary break in remote.c Shawn O. Pearce

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).