5 ensure_git_version_isnt $VERSION_LOWER "2.5.0"
6 envInitConfig='git config filter.lfs.process = "git-lfs filter-process"
7 git config filter.lfs.smudge = "git-lfs smudge -- %f"
8 git config filter.lfs.clean = "git-lfs clean -- %f"'
10 begin_test "git worktree"
13 reponame="worktree-main"
18 # can't create a worktree until there's 1 commit at least
21 git commit -m "Initial commit"
23 expected=$(printf "%s\n%s\n
24 LocalWorkingDir=$(native_path_escaped "$TRASHDIR/$reponame")
25 LocalGitDir=$(native_path_escaped "$TRASHDIR/$reponame/.git")
26 LocalGitStorageDir=$(native_path_escaped "$TRASHDIR/$reponame/.git")
27 LocalMediaDir=$(native_path_escaped "$TRASHDIR/$reponame/.git/lfs/objects")
29 TempDir=$(native_path_escaped "$TRASHDIR/$reponame/.git/lfs/tmp")
32 BasicTransfersOnly=false
33 SkipDownloadErrors=false
34 FetchRecentAlways=false
36 FetchRecentCommitsDays=0
37 FetchRecentRefsIncludeRemotes=true
39 PruneVerifyRemoteAlways=false
40 PruneRemoteName=origin
41 LfsStorageDir=$(native_path_escaped "$TRASHDIR/$reponame/.git/lfs")
44 DownloadTransfers=basic
46 $(escape_path "$(env | grep "^GIT")")
48 " "$(git lfs version)" "$(git version)" "$envInitConfig")
49 actual=$(git lfs env | grep -v "^GIT_EXEC_PATH=")
50 contains_same_elements "$expected" "$actual"
52 worktreename="worktree-2"
53 git worktree add "$TRASHDIR/$worktreename"
54 cd "$TRASHDIR/$worktreename"
56 # git dir in worktree is like submodules (except path is worktrees) but this
57 # is only for index, temp etc
58 # storage of git objects and lfs objects is in the original .git
59 expected=$(printf "%s\n%s\n
60 LocalWorkingDir=$(native_path_escaped "$TRASHDIR/$worktreename")
61 LocalGitDir=$(native_path_escaped "$TRASHDIR/$reponame/.git/worktrees/$worktreename")
62 LocalGitStorageDir=$(native_path_escaped "$TRASHDIR/$reponame/.git")
63 LocalMediaDir=$(native_path_escaped "$TRASHDIR/$reponame/.git/lfs/objects")
65 TempDir=$(native_path_escaped "$TRASHDIR/$reponame/.git/worktrees/$worktreename/lfs/tmp")
68 BasicTransfersOnly=false
69 SkipDownloadErrors=false
70 FetchRecentAlways=false
72 FetchRecentCommitsDays=0
73 FetchRecentRefsIncludeRemotes=true
75 PruneVerifyRemoteAlways=false
76 PruneRemoteName=origin
77 LfsStorageDir=$(native_path_escaped "$TRASHDIR/$reponame/.git/lfs")
80 DownloadTransfers=basic
82 $(escape_path "$(env | grep "^GIT")")
84 " "$(git lfs version)" "$(git version)" "$envInitConfig")
85 actual=$(git lfs env | grep -v "^GIT_EXEC_PATH=")
86 contains_same_elements "$expected" "$actual"