1#!/bin/sh23test_description='git p4 tests for excluded paths during clone and sync'45. ./lib-git-p4.sh67test_expect_success 'start p4d' '8start_p4d9'1011# Create a repo with the structure:12#13# //depot/wanted/foo14# //depot/discard/foo15#16# Check that we can exclude a subdirectory with both17# clone and sync operations.1819test_expect_success 'create exclude repo' '20(21cd "$cli" &&22mkdir -p wanted discard &&23echo wanted >wanted/foo &&24echo discard >discard/foo &&25p4 add wanted/foo discard/foo &&26p4 submit -d "initial revision"27)28'2930test_expect_success 'check the repo was created correctly' '31test_when_finished cleanup_git &&32git p4 clone --dest="$git" //depot/...@all &&33(34cd "$git" &&35test_path_is_file wanted/foo &&36test_path_is_file discard/foo37)38'3940test_expect_success 'clone, excluding part of repo' '41test_when_finished cleanup_git &&42git p4 clone -//depot/discard/... --dest="$git" //depot/...@all &&43(44cd "$git" &&45test_path_is_file wanted/foo &&46test_path_is_missing discard/foo47)48'4950test_expect_success 'clone, then sync with exclude' '51test_when_finished cleanup_git &&52git p4 clone -//depot/discard/... --dest="$git" //depot/...@all &&53(54cd "$cli" &&55p4 edit wanted/foo discard/foo &&56date >>wanted/foo &&57date >>discard/foo &&58p4 submit -d "updating" &&5960cd "$git" &&61git p4 sync -//depot/discard/... &&62test_path_is_file wanted/foo &&63test_path_is_missing discard/foo64)65'6667test_done