summaryrefslogtreecommitdiff
path: root/remote.c
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2007-09-25 00:13:19 -0400
committerJunio C Hamano <gitster@pobox.com>2007-09-24 23:25:19 -0700
commit7dfee372b08f653c2709c90bea986e4ed608f410 (patch)
tree552c6f27e3f1235e1fb7c09f07ce3e02d2b58f67 /remote.c
parent009c5bcd24da3cd2670962e405585e31d662487d (diff)
downloadgit-7dfee372b08f653c2709c90bea986e4ed608f410.tar.gz
Cleanup unnecessary break in remote.c
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> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'remote.c')
-rw-r--r--remote.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/remote.c b/remote.c
index ac354f3795..2166a2bf15 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;
}