Mercurial > public > mercurial-scm > hg
diff tests/test-add.t @ 24537:2bb13f2b778c stable
dirstate: don't require exact case when adding dirs on icasefs (issue4578)
We don't require it when adding files on a case insensitive filesystem, so don't
require it to add directories for consistency.
The problem with the previous code was that _walkexplicit() was only returning
the normalized directory. The file(s) in the directory are then appended, and
passed to the matcher. But if the user asks for 'capsdir1/capsdir', the matcher
will not accept 'CapsDir1/CapsDir/AbC.txt', and the name is dropped. Matching
based on the non-normalized name is required.
If not normalizing, skip the extra string building for efficiency. '.' is
replaced with '' so that the path being tested when no file is specified, isn't
prefixed with './' (and therefore fail the match).
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Tue, 31 Mar 2015 11:11:39 -0400 |
parents | 10697f29af2b |
children | c780a63f61ca |
line wrap: on
line diff
--- a/tests/test-add.t Tue Mar 31 11:58:14 2015 -0700 +++ b/tests/test-add.t Tue Mar 31 11:11:39 2015 -0400 @@ -169,4 +169,16 @@ $ cat d file d +Test that adding a directory doesn't require case matching (issue4578) +#if icasefs + $ mkdir -p CapsDir1/CapsDir + $ echo abc > CapsDir1/CapsDir/AbC.txt + $ mkdir CapsDir1/CapsDir/SubDir + $ echo def > CapsDir1/CapsDir/SubDir/Def.txt + + $ hg add -v capsdir1/capsdir + adding CapsDir1/CapsDir/AbC.txt (glob) + adding CapsDir1/CapsDir/SubDir/Def.txt (glob) +#endif + $ cd ..