Skip to content

Commit 59c276c

Browse files
committed
Sync with v2.16.1
* maint: Git 2.16.1 t5601-clone: test case-conflicting files on case-insensitive filesystem repository: pre-initialize hash algo pointer
2 parents 298d861 + 8279ed0 commit 59c276c

File tree

3 files changed

+29
-1
lines changed

3 files changed

+29
-1
lines changed

Documentation/RelNotes/2.16.1.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Git v2.16.1 Release Notes
2+
=========================
3+
4+
Fixes since v2.16
5+
-----------------
6+
7+
* "git clone" segfaulted when cloning a project that happens to
8+
track two paths that differ only in case on a case insensitive
9+
filesystem.
10+
11+
Does not contain any other documentation updates or code clean-ups.

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)