]> git.ipfire.org Git - thirdparty/git.git/commit - git-p4.py
git-p4: match branches case insensitively if configured
authorMazo, Andrey <amazo@checkvideo.com>
Mon, 1 Apr 2019 18:02:24 +0000 (18:02 +0000)
committerJunio C Hamano <gitster@pobox.com>
Tue, 2 Apr 2019 02:25:41 +0000 (11:25 +0900)
commitf2768cb343cb0320f79692625dea7f50af643759
tree7e0e0bea253ef926b7fe682a680bf64414772ce5
parentb30efb156f148081bfb912a2269666864e3937b2
git-p4: match branches case insensitively if configured

git-p4 knows how to handle case insensitivity in file paths
if core.ignorecase is set.
However, when determining a branch for a file,
it still does a case-sensitive prefix match.
This may result in some file changes to be lost on import.

For example, given the following commits
 1. add //depot/main/file1
 2. add //depot/DirA/file2
 3. add //depot/dira/file3
 4. add //depot/DirA/file4
and "branchList = main:DirA" branch mapping,
commit 3 will be lost.

So, do branch search case insensitively if running with core.ignorecase set.
Teach splitFilesIntoBranches() to use the p4PathStartsWith() function
for path prefix matches instead of always case-sensitive match.

Signed-off-by: Andrey Mazo <amazo@checkvideo.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-p4.py
t/t9801-git-p4-branch.sh