]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'jk/rev-input-given-fix'
authorJunio C Hamano <gitster@pobox.com>
Mon, 31 Aug 2020 22:49:52 +0000 (15:49 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 31 Aug 2020 22:49:52 +0000 (15:49 -0700)
Feeding "$ZERO_OID" to "git log --ignore-missing --stdin", and
running "git log --ignore-missing $ZERO_OID" fell back to start
digging from HEAD; it has been corrected to become a no-op, like
"git log --tags=no-tag-matches-this-pattern" does.

* jk/rev-input-given-fix:
  revision: set rev_input_given in handle_revision_arg()

1  2 
revision.c
t/t4202-log.sh

diff --cc revision.c
index 96630e31867dd6987b8d5447bcaedb777303679d,d7d4bd3ff79896d439e28f2280582ac05c3ee56a..08c2ad23af668a42cca30a5cebfcc2feee1ce895
@@@ -2092,11 -2072,19 +2092,19 @@@ static int handle_revision_arg_1(const 
        return 0;
  }
  
+ int handle_revision_arg(const char *arg, struct rev_info *revs, int flags, unsigned revarg_opt)
+ {
+       int ret = handle_revision_arg_1(arg, revs, flags, revarg_opt);
+       if (!ret)
+               revs->rev_input_given = 1;
+       return ret;
+ }
  static void read_pathspec_from_stdin(struct strbuf *sb,
 -                                   struct argv_array *prune)
 +                                   struct strvec *prune)
  {
        while (strbuf_getline(sb, stdin) != EOF)
 -              argv_array_push(prune, sb->buf);
 +              strvec_push(prune, sb->buf);
  }
  
  static void read_revisions_from_stdin(struct rev_info *revs,
@@@ -2703,8 -2682,8 +2711,8 @@@ static void NORETURN diagnose_missing_d
   */
  int setup_revisions(int argc, const char **argv, struct rev_info *revs, struct setup_revision_opt *opt)
  {
-       int i, flags, left, seen_dashdash, got_rev_arg = 0, revarg_opt;
+       int i, flags, left, seen_dashdash, revarg_opt;
 -      struct argv_array prune_data = ARGV_ARRAY_INIT;
 +      struct strvec prune_data = STRVEC_INIT;
        const char *submodule = NULL;
        int seen_end_of_options = 0;
  
                        for (j = i; j < argc; j++)
                                verify_filename(revs->prefix, argv[j], j == i);
  
 -                      argv_array_pushv(&prune_data, argv + i);
 +                      strvec_pushv(&prune_data, argv + i);
                        break;
                }
-               else
-                       got_rev_arg = 1;
        }
  
 -      if (prune_data.argc) {
 +      if (prune_data.nr) {
                /*
                 * If we need to introduce the magic "a lone ':' means no
                 * pathspec whatsoever", here is the place to do so.
diff --cc t/t4202-log.sh
Simple merge