]> asedeno.scripts.mit.edu Git - git.git/blobdiff - revision.c
Merge branch 'ml/color-grep'
[git.git] / revision.c
index 438cc87b17fa3a5a7b57c3fcdf4289cd869b79a7..490b484084e875e9b6c5aea1168437bba4bb500a 100644 (file)
@@ -547,6 +547,9 @@ static void cherry_pick_list(struct commit_list *list, struct rev_info *revs)
                        right_count++;
        }
 
+       if (!left_count || !right_count)
+               return;
+
        left_first = left_count < right_count;
        init_patch_ids(&ids);
        if (revs->diffopt.nr_paths) {
@@ -1331,7 +1334,7 @@ static void append_prune_data(const char ***prune_data, const char **av)
  */
 int setup_revisions(int argc, const char **argv, struct rev_info *revs, const char *def)
 {
-       int i, flags, left, seen_dashdash, read_from_stdin;
+       int i, flags, left, seen_dashdash, read_from_stdin, got_rev_arg = 0;
        const char **prune_data = NULL;
 
        /* First, search for "--" */
@@ -1457,6 +1460,8 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch
                        append_prune_data(&prune_data, argv + i);
                        break;
                }
+               else
+                       got_rev_arg = 1;
        }
 
        if (prune_data)
@@ -1466,7 +1471,7 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch
                revs->def = def;
        if (revs->show_merge)
                prepare_show_merge(revs);
-       if (revs->def && !revs->pending.nr) {
+       if (revs->def && !revs->pending.nr && !got_rev_arg) {
                unsigned char sha1[20];
                struct object *object;
                unsigned mode;