diff options
author | Mazo, Andrey <amazo@checkvideo.com> | 2019-04-01 21:02:32 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-04-02 05:25:41 +0300 |
commit | a2bee10ad9ed4dc45c1f7da76f01388925b80212 (patch) | |
tree | 810beb7f27c96c7fe252f595dbc94db538d046a3 /t/t9817-git-p4-exclude.sh | |
parent | d6045201fcec7bd9738fea4daf9d176d8df9f5ba (diff) |
git-p4: don't exclude other files with same prefix
Make sure not to exclude files unintentionally
if exclude paths are specified without a trailing /.
I.e., don't exclude "//depot/file_dont_exclude" if run with "-//depot/file".
Do this by ensuring that paths without a trailing "/" are only matched completely.
Also, abort path search on the first match as a micro-optimization.
Signed-off-by: Andrey Mazo <amazo@checkvideo.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t9817-git-p4-exclude.sh')
-rwxr-xr-x | t/t9817-git-p4-exclude.sh | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/t/t9817-git-p4-exclude.sh b/t/t9817-git-p4-exclude.sh index 1c22570797..275dd30425 100755 --- a/t/t9817-git-p4-exclude.sh +++ b/t/t9817-git-p4-exclude.sh @@ -53,7 +53,7 @@ test_expect_success 'clone, excluding part of repo' ' ) ' -test_expect_failure 'clone, excluding single file, no trailing /' ' +test_expect_success 'clone, excluding single file, no trailing /' ' test_when_finished cleanup_git && git p4 clone -//depot/discard_file --dest="$git" //depot/...@all && ( @@ -85,7 +85,7 @@ test_expect_success 'clone, then sync with exclude' ' ) ' -test_expect_failure 'clone, then sync with exclude, no trailing /' ' +test_expect_success 'clone, then sync with exclude, no trailing /' ' test_when_finished cleanup_git && git p4 clone -//depot/discard/... -//depot/discard_file --dest="$git" //depot/...@all && ( |