Re: [WIP/RFC 09/13] git notes merge: Initial implementation handling trivial merges only
On Saturday 24 July 2010, Stephen Boyd wrote:
Show 17 quoted lines
> On 07/23/2010 03:15 AM, Johan Herland wrote:
> > + if (1< argc) {
> > + error("too many parameters");
> > + usage_with_options(git_notes_merge_usage, options);
> > + } else if (1> argc) {
> > + error("too few parameters");
> > + usage_with_options(git_notes_merge_usage, options);
> > + }
> > +
>
> Looks like it only takes one <notes_ref>. In that case wouldn't it be
> better to say
>
> if (argc != 1) {
> error("Must specify a note ref to merge");
> usage_with_options(git_notes_merge_usage, options)
> }Thanks. I'll squash the following into the next iteration:
...Johan
diff --git a/builtin/notes.c b/builtin/notes.c
index f2bc767..ca0e4d9 100644
--- a/builtin/notes.c
+++ b/builtin/notes.c
@@ -780,11 +780,8 @@ static int merge(int argc, const char **argv, const char *prefix)
argc = parse_options(argc, argv, prefix, options,
git_notes_merge_usage, 0);
- if (1 < argc) {
- error("too many parameters");
- usage_with_options(git_notes_merge_usage, options);
- } else if (1 > argc) {
- error("too few parameters");
+ if (argc != 1) {
+ error("Must specify a notes ref to merge");
usage_with_options(git_notes_merge_usage, options);
}
--
Johan Herland, <johan@herland.net>
www.herland.net