Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2019-07-10 01:25:40 +0300
committerJunio C Hamano <gitster@pobox.com>2019-07-10 01:25:40 +0300
commit44275f5e1bef37304f5a9da65b588e344eb00a72 (patch)
treee5e5efaf04d1c549d4a5b919fdc4c46b804b1574 /t/t9817-git-p4-exclude.sh
parent99af5bedbda020571995f207e30a617310472a04 (diff)
parentd15068a6501bec72fddec9f79372a5e3ce5e1379 (diff)
Merge branch 'am/p4-branches-excludes'
"git p4" update. * am/p4-branches-excludes: git-p4: respect excluded paths when detecting branches git-p4: add failing test for "git-p4: respect excluded paths when detecting branches" git-p4: don't exclude other files with same prefix git-p4: add failing test for "don't exclude other files with same prefix" git-p4: don't groom exclude path list on every commit git-p4: match branches case insensitively if configured git-p4: add failing test for "git-p4: match branches case insensitively if configured" git-p4: detect/prevent infinite loop in gitCommitByP4Change()
Diffstat (limited to 't/t9817-git-p4-exclude.sh')
-rwxr-xr-xt/t9817-git-p4-exclude.sh51
1 files changed, 46 insertions, 5 deletions
diff --git a/t/t9817-git-p4-exclude.sh b/t/t9817-git-p4-exclude.sh
index 96d25f0c02..ec3d937c6a 100755
--- a/t/t9817-git-p4-exclude.sh
+++ b/t/t9817-git-p4-exclude.sh
@@ -22,7 +22,9 @@ test_expect_success 'create exclude repo' '
mkdir -p wanted discard &&
echo wanted >wanted/foo &&
echo discard >discard/foo &&
- p4 add wanted/foo discard/foo &&
+ echo discard_file >discard_file &&
+ echo discard_file_not >discard_file_not &&
+ p4 add wanted/foo discard/foo discard_file discard_file_not &&
p4 submit -d "initial revision"
)
'
@@ -33,7 +35,9 @@ test_expect_success 'check the repo was created correctly' '
(
cd "$git" &&
test_path_is_file wanted/foo &&
- test_path_is_file discard/foo
+ test_path_is_file discard/foo &&
+ test_path_is_file discard_file &&
+ test_path_is_file discard_file_not
)
'
@@ -43,7 +47,21 @@ test_expect_success 'clone, excluding part of repo' '
(
cd "$git" &&
test_path_is_file wanted/foo &&
- test_path_is_missing discard/foo
+ test_path_is_missing discard/foo &&
+ test_path_is_file discard_file &&
+ test_path_is_file discard_file_not
+ )
+'
+
+test_expect_success 'clone, excluding single file, no trailing /' '
+ test_when_finished cleanup_git &&
+ git p4 clone -//depot/discard_file --dest="$git" //depot/...@all &&
+ (
+ cd "$git" &&
+ test_path_is_file wanted/foo &&
+ test_path_is_file discard/foo &&
+ test_path_is_missing discard_file &&
+ test_path_is_file discard_file_not
)
'
@@ -52,15 +70,38 @@ test_expect_success 'clone, then sync with exclude' '
git p4 clone -//depot/discard/... --dest="$git" //depot/...@all &&
(
cd "$cli" &&
- p4 edit wanted/foo discard/foo &&
+ p4 edit wanted/foo discard/foo discard_file_not &&
date >>wanted/foo &&
date >>discard/foo &&
+ date >>discard_file_not &&
p4 submit -d "updating" &&
cd "$git" &&
git p4 sync -//depot/discard/... &&
test_path_is_file wanted/foo &&
- test_path_is_missing discard/foo
+ test_path_is_missing discard/foo &&
+ test_path_is_file discard_file &&
+ test_path_is_file discard_file_not
+ )
+'
+
+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 &&
+ (
+ cd "$cli" &&
+ p4 edit wanted/foo discard/foo discard_file_not &&
+ date >>wanted/foo &&
+ date >>discard/foo &&
+ date >>discard_file_not &&
+ p4 submit -d "updating" &&
+
+ cd "$git" &&
+ git p4 sync -//depot/discard/... -//depot/discard_file &&
+ test_path_is_file wanted/foo &&
+ test_path_is_missing discard/foo &&
+ test_path_is_missing discard_file &&
+ test_path_is_file discard_file_not
)
'