Browse Source
* maint-1.9: Git 1.9.5 Git 1.8.5.6 fsck: complain about NTFS ".git" aliases in trees read-cache: optionally disallow NTFS .git variants path: add is_ntfs_dotgit() helper fsck: complain about HFS+ ".git" aliases in trees read-cache: optionally disallow HFS+ .git variants utf8: add is_hfs_dotgit() helper fsck: notice .git case-insensitively t1450: refactor ".", "..", and ".git" fsck tests verify_dotfile(): reject .git case-insensitively read-tree: add tests for confusing paths like ".." and ".git" unpack-trees: propagate errors adding entries to the indexmaint
Junio C Hamano
10 years ago
17 changed files with 334 additions and 40 deletions
@ -0,0 +1,34 @@
@@ -0,0 +1,34 @@
|
||||
Git v1.8.5.6 Release Notes |
||||
========================== |
||||
|
||||
Fixes since v1.8.5.5 |
||||
-------------------- |
||||
|
||||
* We used to allow committing a path ".Git/config" with Git that is |
||||
running on a case sensitive filesystem, but an attempt to check out |
||||
such a path with Git that runs on a case insensitive filesystem |
||||
would have clobbered ".git/config", which is definitely not what |
||||
the user would have expected. Git now prevents you from tracking |
||||
a path with ".Git" (in any case combination) as a path component. |
||||
|
||||
* On Windows, certain path components that are different from ".git" |
||||
are mapped to ".git", e.g. "git~1/config" is treated as if it were |
||||
".git/config". HFS+ has a similar issue, where certain unicode |
||||
codepoints are ignored, e.g. ".g\u200cit/config" is treated as if |
||||
it were ".git/config". Pathnames with these potential issues are |
||||
rejected on the affected systems. Git on systems that are not |
||||
affected by this issue (e.g. Linux) can also be configured to |
||||
reject them to ensure cross platform interoperability of the hosted |
||||
projects. |
||||
|
||||
* "git fsck" notices a tree object that records such a path that can |
||||
be confused with ".git", and with receive.fsckObjects configuration |
||||
set to true, an attempt to "git push" such a tree object will be |
||||
rejected. Such a path may not be a problem on a well behaving |
||||
filesystem but in order to protect those on HFS+ and on case |
||||
insensitive filesystems, this check is enabled on all platforms. |
||||
|
||||
A big "thanks!" for bringing this issue to us goes to our friends in |
||||
the Mercurial land, namely, Matt Mackall and Augie Fackler. |
||||
|
||||
Also contains typofixes, documentation updates and trivial code clean-ups. |
@ -0,0 +1,34 @@
@@ -0,0 +1,34 @@
|
||||
Git v1.9.5 Release Notes |
||||
======================== |
||||
|
||||
Fixes since v1.9.4 |
||||
------------------ |
||||
|
||||
* We used to allow committing a path ".Git/config" with Git that is |
||||
running on a case sensitive filesystem, but an attempt to check out |
||||
such a path with Git that runs on a case insensitive filesystem |
||||
would have clobbered ".git/config", which is definitely not what |
||||
the user would have expected. Git now prevents you from tracking |
||||
a path with ".Git" (in any case combination) as a path component. |
||||
|
||||
* On Windows, certain path components that are different from ".git" |
||||
are mapped to ".git", e.g. "git~1/config" is treated as if it were |
||||
".git/config". HFS+ has a similar issue, where certain unicode |
||||
codepoints are ignored, e.g. ".g\u200cit/config" is treated as if |
||||
it were ".git/config". Pathnames with these potential issues are |
||||
rejected on the affected systems. Git on systems that are not |
||||
affected by this issue (e.g. Linux) can also be configured to |
||||
reject them to ensure cross platform interoperability of the hosted |
||||
projects. |
||||
|
||||
* "git fsck" notices a tree object that records such a path that can |
||||
be confused with ".git", and with receive.fsckObjects configuration |
||||
set to true, an attempt to "git push" such a tree object will be |
||||
rejected. Such a path may not be a problem on a well behaving |
||||
filesystem but in order to protect those on HFS+ and on case |
||||
insensitive filesystems, this check is enabled on all platforms. |
||||
|
||||
A big "thanks!" for bringing this issue to us goes to our friends in |
||||
the Mercurial land, namely, Matt Mackall and Augie Fackler. |
||||
|
||||
Also contains typofixes, documentation updates and trivial code clean-ups. |
@ -0,0 +1,62 @@
@@ -0,0 +1,62 @@
|
||||
#!/bin/sh |
||||
|
||||
test_description='check that read-tree rejects confusing paths' |
||||
. ./test-lib.sh |
||||
|
||||
test_expect_success 'create base tree' ' |
||||
echo content >file && |
||||
git add file && |
||||
git commit -m base && |
||||
blob=$(git rev-parse HEAD:file) && |
||||
tree=$(git rev-parse HEAD^{tree}) |
||||
' |
||||
|
||||
test_expect_success 'enable core.protectHFS for rejection tests' ' |
||||
git config core.protectHFS true |
||||
' |
||||
|
||||
test_expect_success 'enable core.protectNTFS for rejection tests' ' |
||||
git config core.protectNTFS true |
||||
' |
||||
|
||||
while read path pretty; do |
||||
: ${pretty:=$path} |
||||
case "$path" in |
||||
*SPACE) |
||||
path="${path%SPACE} " |
||||
;; |
||||
esac |
||||
test_expect_success "reject $pretty at end of path" ' |
||||
printf "100644 blob %s\t%s" "$blob" "$path" >tree && |
||||
bogus=$(git mktree <tree) && |
||||
test_must_fail git read-tree $bogus |
||||
' |
||||
|
||||
test_expect_success "reject $pretty as subtree" ' |
||||
printf "040000 tree %s\t%s" "$tree" "$path" >tree && |
||||
bogus=$(git mktree <tree) && |
||||
test_must_fail git read-tree $bogus |
||||
' |
||||
done <<-EOF |
||||
. |
||||
.. |
||||
.git |
||||
.GIT |
||||
${u200c}.Git {u200c}.Git |
||||
.gI${u200c}T .gI{u200c}T |
||||
.GiT${u200c} .GiT{u200c} |
||||
git~1 |
||||
.git.SPACE .git.{space} |
||||
.\\\\.GIT\\\\foobar backslashes |
||||
.git\\\\foobar backslashes2 |
||||
EOF |
||||
|
||||
test_expect_success 'utf-8 paths allowed with core.protectHFS off' ' |
||||
test_when_finished "git read-tree HEAD" && |
||||
test_config core.protectHFS false && |
||||
printf "100644 blob %s\t%s" "$blob" ".gi${u200c}t" >tree && |
||||
ok=$(git mktree <tree) && |
||||
git read-tree $ok |
||||
' |
||||
|
||||
test_done |
Loading…
Reference in new issue