Skip to content

Commit ea7b5de

Browse files
committed
Merge branch 'bc/hash-algo' into maint
* bc/hash-algo: t5601-clone: test case-conflicting files on case-insensitive filesystem repository: pre-initialize hash algo pointer
2 parents 2512f15 + b6947af commit ea7b5de

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

repository.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
/* The main repository */
77
static struct repository the_repo = {
8-
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, &the_index, NULL, 0, 0
8+
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, &the_index, &hash_algos[GIT_HASH_SHA1], 0, 0
99
};
1010
struct repository *the_repository = &the_repo;
1111

t/t5601-clone.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -611,4 +611,21 @@ test_expect_success 'GIT_TRACE_PACKFILE produces a usable pack' '
611611
git -C replay.git index-pack -v --stdin <tmp.pack
612612
'
613613

614+
hex2oct () {
615+
perl -ne 'printf "\\%03o", hex for /../g'
616+
}
617+
618+
test_expect_success 'clone on case-insensitive fs' '
619+
git init icasefs &&
620+
(
621+
cd icasefs
622+
o=$(git hash-object -w --stdin </dev/null | hex2oct) &&
623+
t=$(printf "100644 X\0${o}100644 x\0${o}" |
624+
git hash-object -w -t tree --stdin) &&
625+
c=$(git commit-tree -m bogus $t) &&
626+
git update-ref refs/heads/bogus $c &&
627+
git clone -b bogus . bogus
628+
)
629+
'
630+
614631
test_done

0 commit comments

Comments
 (0)