Code

Merge branch 'jc/maint-1.7.4-pathspec-stdin-and-cmdline'
authorJunio C Hamano <gitster@pobox.com>
Wed, 11 May 2011 22:05:01 +0000 (15:05 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 11 May 2011 23:09:25 +0000 (16:09 -0700)
Update the fix for 1.7.5 maintenance track.

* jc/maint-1.7.4-pathspec-stdin-and-cmdline:
  setup_revisions(): take pathspec from command line and --stdin correctly

1  2 
revision.c

diff --cc revision.c
index 0f38364cf3f81a9088305ca802adf8b7c9260e91,073173eb9c48ec08a8fb30adf6bbd8b6ce54b1cc..707a703a09d6c7ffc1adfcd89da83d5b97da397f
@@@ -1541,6 -1459,8 +1512,7 @@@ int setup_revisions(int argc, const cha
        const char *optarg;
        int argcount;
  
 -
+       memset(&prune_data, 0, sizeof(prune_data));
        if (opt)
                submodule = opt->submodule;
  
                        got_rev_arg = 1;
        }
  
-       if (prune_data)
-               init_pathspec(&revs->prune_data, get_pathspec(revs->prefix, prune_data));
+       if (prune_data.nr) {
+               ALLOC_GROW(prune_data.path, prune_data.nr+1, prune_data.alloc);
+               prune_data.path[prune_data.nr++] = NULL;
 -              revs->prune_data = get_pathspec(revs->prefix, prune_data.path);
++              init_pathspec(&revs->prune_data,
++                            get_pathspec(revs->prefix, prune_data.path));
+       }
  
        if (revs->def == NULL)
                revs->def = opt ? opt->def : NULL;