Skip to content

Commit daafb50

Browse files
committed
Merge branch 'mh/packed-ref-store-prep'
Fix regression to "gitk --bisect" by a recent update. * mh/packed-ref-store-prep: rev-parse: don't trim bisect refnames
2 parents c39da2c + 1d0538e commit daafb50

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

builtin/rev-parse.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -757,8 +757,8 @@ int cmd_rev_parse(int argc, const char **argv, const char *prefix)
757757
continue;
758758
}
759759
if (!strcmp(arg, "--bisect")) {
760-
for_each_ref_in("refs/bisect/bad", show_reference, NULL);
761-
for_each_ref_in("refs/bisect/good", anti_reference, NULL);
760+
for_each_fullref_in("refs/bisect/bad", show_reference, NULL, 0);
761+
for_each_fullref_in("refs/bisect/good", anti_reference, NULL, 0);
762762
continue;
763763
}
764764
if (opt_with_value(arg, "--branches", &arg)) {

t/t6002-rev-list-bisect.sh

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,17 +236,31 @@ test_sequence "--bisect"
236236
#
237237
#
238238

239-
test_expect_success '--bisect can default to good/bad refs' '
239+
test_expect_success 'set up fake --bisect refs' '
240240
git update-ref refs/bisect/bad c3 &&
241241
good=$(git rev-parse b1) &&
242242
git update-ref refs/bisect/good-$good $good &&
243243
good=$(git rev-parse c1) &&
244-
git update-ref refs/bisect/good-$good $good &&
244+
git update-ref refs/bisect/good-$good $good
245+
'
245246

247+
test_expect_success 'rev-list --bisect can default to good/bad refs' '
246248
# the only thing between c3 and c1 is c2
247249
git rev-parse c2 >expect &&
248250
git rev-list --bisect >actual &&
249251
test_cmp expect actual
250252
'
251253

254+
test_expect_success 'rev-parse --bisect can default to good/bad refs' '
255+
git rev-parse c3 ^b1 ^c1 >expect &&
256+
git rev-parse --bisect >actual &&
257+
258+
# output order depends on the refnames, which in turn depends on
259+
# the exact sha1s. We just want to make sure we have the same set
260+
# of lines in any order.
261+
sort <expect >expect.sorted &&
262+
sort <actual >actual.sorted &&
263+
test_cmp expect.sorted actual.sorted
264+
'
265+
252266
test_done

0 commit comments

Comments
 (0)