File tree 3 files changed +56
-0
lines changed
3 files changed +56
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+ set -eu -o pipefail
3
+
4
+ git init -q
5
+
6
+ mkdir -p .git/refs/heads/a
7
+ cat << EOF >.git/packed-refs
8
+ # pack-refs with: peeled fully-peeled sorted
9
+ 1111111111111111111111111111111111111111 refs/heads/a-
10
+ 2222222222222222222222222222222222222222 refs/heads/a/b
11
+ 3333333333333333333333333333333333333333 refs/heads/a0
12
+ EOF
13
+
14
+ mkdir -p .git/refs/heads/a
15
+ echo aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa > .git/refs/heads/a-
16
+ echo bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb > .git/refs/heads/a/b
17
+ echo cccccccccccccccccccccccccccccccccccccccc > .git/refs/heads/a0
Original file line number Diff line number Diff line change @@ -464,6 +464,45 @@ fn overlay_iter_reproduce_1850() -> crate::Result {
464
464
Ok ( ( ) )
465
465
}
466
466
467
+ #[ test]
468
+ fn overlay_iter_reproduce_1928 ( ) -> crate :: Result {
469
+ let store = store_at ( "make_repo_for_1928_repro.sh" ) ?;
470
+ let ref_names = store
471
+ . iter ( ) ?
472
+ . all ( ) ?
473
+ . map ( |r| r. map ( |r| ( r. name . as_bstr ( ) . to_owned ( ) , r. target ) ) )
474
+ . collect :: < Result < Vec < _ > , _ > > ( ) ?;
475
+ insta:: assert_debug_snapshot!( ref_names, @r#"
476
+ [
477
+ (
478
+ "refs/heads/a-",
479
+ Object(
480
+ Sha1(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa),
481
+ ),
482
+ ),
483
+ (
484
+ "refs/heads/a/b",
485
+ Object(
486
+ Sha1(2222222222222222222222222222222222222222),
487
+ ),
488
+ ),
489
+ (
490
+ "refs/heads/a0",
491
+ Object(
492
+ Sha1(cccccccccccccccccccccccccccccccccccccccc),
493
+ ),
494
+ ),
495
+ (
496
+ "refs/heads/a/b",
497
+ Object(
498
+ Sha1(bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb),
499
+ ),
500
+ ),
501
+ ]
502
+ "# ) ;
503
+ Ok ( ( ) )
504
+ }
505
+
467
506
#[ test]
468
507
fn overlay_iter_with_prefix_wont_allow_absolute_paths ( ) -> crate :: Result {
469
508
let store = store_with_packed_refs ( ) ?;
You can’t perform that action at this time.
0 commit comments