summaryrefslogtreecommitdiff
path: root/t/t9822-git-p4-path-encoding.sh
diff options
context:
space:
mode:
authorLars Schneider <larsxschneider@gmail.com>2017-02-09 15:06:56 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-02-10 22:33:13 (GMT)
commita8b05162e894b88aeb7d5064daba07e1a4f58463 (patch)
tree138b28f52415d7eca09b72b1e51897270e8c8304 /t/t9822-git-p4-path-encoding.sh
parent50b4a7807f5f1db79a0a4f4400c29bc00efbd307 (diff)
downloadgit-a8b05162e894b88aeb7d5064daba07e1a4f58463.zip
git-a8b05162e894b88aeb7d5064daba07e1a4f58463.tar.gz
git-a8b05162e894b88aeb7d5064daba07e1a4f58463.tar.bz2
git-p4: fix git-p4.pathEncoding for removed files
In a9e38359e3 we taught git-p4 a way to re-encode path names from what was used in Perforce to UTF-8. This path re-encoding worked properly for "added" paths. "Removed" paths were not re-encoded and therefore different from the "added" paths. Consequently, these files were not removed in a git-p4 cloned Git repository because the path names did not match. Fix this by moving the re-encoding to a place that affects "added" and "removed" paths. Add a test to demonstrate the issue. Signed-off-by: Lars Schneider <larsxschneider@gmail.com> Reviewed-by: Luke Diamand <luke@diamand.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t9822-git-p4-path-encoding.sh')
-rwxr-xr-xt/t9822-git-p4-path-encoding.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/t/t9822-git-p4-path-encoding.sh b/t/t9822-git-p4-path-encoding.sh
index 7b83e69..c78477c 100755
--- a/t/t9822-git-p4-path-encoding.sh
+++ b/t/t9822-git-p4-path-encoding.sh
@@ -51,6 +51,22 @@ test_expect_success 'Clone repo containing iso8859-1 encoded paths with git-p4.p
)
'
+test_expect_success 'Delete iso8859-1 encoded paths and clone' '
+ (
+ cd "$cli" &&
+ ISO8859="$(printf "$ISO8859_ESCAPED")" &&
+ p4 delete "$ISO8859" &&
+ p4 submit -d "remove file"
+ ) &&
+ git p4 clone --destination="$git" //depot@all &&
+ test_when_finished cleanup_git &&
+ (
+ cd "$git" &&
+ git -c core.quotepath=false ls-files >actual &&
+ test_must_be_empty actual
+ )
+'
+
test_expect_success 'kill p4d' '
kill_p4d
'