Merge branch 'cc/maint-bisect-paths' into maint-1.6.6
authorJunio C Hamano <gitster@pobox.com>
Sun, 7 Mar 2010 22:53:35 +0000 (14:53 -0800)
committerJunio C Hamano <gitster@pobox.com>
Sun, 7 Mar 2010 22:53:35 +0000 (14:53 -0800)
* cc/maint-bisect-paths:
bisect: error out when passing bad path parameters

1  2 
bisect.c
diff --combined bisect.c
index b779a9589aae28ed8e92ca64309fb62936480e9d,88881f7b6ed7a69498561912dbf4934697c17e4b..e4214c99093da5201e2f06b196a4fa64c684ce61
+++ b/bisect.c
@@@ -956,7 -956,7 +956,7 @@@ int bisect_next_all(const char *prefix
  {
        struct rev_info revs;
        struct commit_list *tried;
 -      int reaches = 0, all = 0, nr;
 +      int reaches = 0, all = 0, nr, steps;
        const unsigned char *bisect_rev;
        char bisect_rev_hex[41];
  
                exit(1);
        }
  
+       if (!all) {
+               fprintf(stderr, "No testable commit found.\n"
+                       "Maybe you started with bad path parameters?\n");
+               exit(4);
+       }
        bisect_rev = revs.commits->item->object.sha1;
        memcpy(bisect_rev_hex, sha1_to_hex(bisect_rev), 41);
  
        }
  
        nr = all - reaches - 1;
 -      printf("Bisecting: %d revisions left to test after this "
 -             "(roughly %d steps)\n", nr, estimate_bisect_steps(all));
 +      steps = estimate_bisect_steps(all);
 +      printf("Bisecting: %d revision%s left to test after this "
 +             "(roughly %d step%s)\n", nr, (nr == 1 ? "" : "s"),
 +             steps, (steps == 1 ? "" : "s"));
  
        return bisect_checkout(bisect_rev_hex);
  }