show: fix "range implies walking"

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Junio C Hamano committed Jun 19, 2012 at 14:15 UTC c5941f1aac071addc1c9b0781c323b588c542420
2 files changed +5 -2
builtin/log.c
+3
@@ -451,6 +451,9 @@ int cmd_show(int argc, const char **argv, const char *prefix)
451 opt.tweak = show_rev_tweak_rev;
452 cmd_log_init(argc, argv, prefix, &rev, &opt);
453
454 + if (!rev.no_walk)
455 + return cmd_log_walk(&rev);
456 +
457 count = rev.pending.nr;
458 objects = rev.pending.objects;
459 for (i = 0; i < count && !ret; i++) {
t/t7007-show.sh
+2 -2
@@ -57,7 +57,7 @@ test_expect_success 'showing a range walks (Y shape, ^ first)' '
57 test_cmp expect actual.filtered
58 '
59
60 -test_expect_failure 'showing a range walks (Y shape, ^ last)' '
60 +test_expect_success 'showing a range walks (Y shape, ^ last)' '
61 cat >expect <<-EOF &&
62 commit $(git rev-parse main3)
63 commit $(git rev-parse main2)
@@ -98,7 +98,7 @@ test_expect_success 'showing annotated tag plus commit' '
98 test_cmp expect actual.filtered
99 '
100
101 -test_expect_failure 'showing range' '
101 +test_expect_success 'showing range' '
102 cat >expect <<-EOF &&
103 commit $(git rev-parse main3)
104 commit $(git rev-parse main2)