Merge branch 'jk/diff-follow-must-take-one-pathspec'
authorJunio C Hamano <gitster@pobox.com>
Mon, 16 Jun 2014 17:07:09 +0000 (10:07 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 16 Jun 2014 17:07:09 +0000 (10:07 -0700)
* jk/diff-follow-must-take-one-pathspec:
move "--follow needs one pathspec" rule to diff_setup_done

1  2 
builtin/log.c
diff.c
diff --cc builtin/log.c
Simple merge
diff --cc diff.c
index f66716fab4b477c58434126b4aaa4b4372ce163a,a99b925ac74bc4f513bd9d860e757f385cca871b..de25819e4edede0a24ee30b202dee478165b4fed
--- 1/diff.c
--- 2/diff.c
+++ b/diff.c
@@@ -3319,7 -3318,8 +3319,10 @@@ void diff_setup_done(struct diff_option
                DIFF_OPT_SET(options, EXIT_WITH_STATUS);
        }
  
 +      options->diff_path_counter = 0;
++
+       if (DIFF_OPT_TST(options, FOLLOW_RENAMES) && options->pathspec.nr != 1)
+               die(_("--follow requires exactly one pathspec"));
  }
  
  static int opt_arg(const char *arg, int arg_short, const char *arg_long, int *val)