@@ -15,6 +15,7 @@ setup() {
1515
1616 # Projects sit at <root>/<category>/<project> and always hold a .git.
1717 # wordpress projects carry a .git alongside their bedrock/site app dir;
18+ # clinimed-style projects have .git only inside bedrock/trellis subdirs;
1819 # vcpkg is a nested submodule (deeper) that must be excluded from scans.
1920 mkdir -p \
2021 " ${ROOT} /mods/HoldFast/.git" \
@@ -24,7 +25,9 @@ setup() {
2425 " ${ROOT} /wordpress/acme/.git" \
2526 " ${ROOT} /wordpress/acme/site" \
2627 " ${ROOT} /wordpress/beta/.git" \
27- " ${ROOT} /wordpress/beta/bedrock"
28+ " ${ROOT} /wordpress/beta/bedrock" \
29+ " ${ROOT} /wordpress/clinimed/bedrock/.git" \
30+ " ${ROOT} /wordpress/clinimed/trellis/.git"
2831
2932 # shell/aliases sources ${HOME}/.dotfiles/shell/os.sh, so point HOME at a
3033 # temp dir whose .dotfiles symlinks to this repo. That lets the suite run
@@ -46,7 +49,7 @@ teardown() {
4649@test " scan finds category/project dirs and excludes nested submodules" {
4750 local out
4851 out=" $( _project_open_scan | sed " s#^${ROOT} /##" | LC_ALL=C sort | tr ' \n' ' ,' ) "
49- assert_equal " ${out} " " misc/khuey,mods/HoldFast,wordpress/acme,wordpress/beta,"
52+ assert_equal " ${out} " " misc/khuey,mods/HoldFast,wordpress/acme,wordpress/beta,wordpress/clinimed, "
5053}
5154
5255@test " po_refresh creates the cache file" {
@@ -106,6 +109,11 @@ teardown() {
106109 assert_output " ${ROOT} /wordpress/acme"
107110}
108111
112+ @test " resolve maps a nested-git project (no root .git) to its path" {
113+ run _project_open_resolve clinimed
114+ assert_output " ${ROOT} /wordpress/clinimed"
115+ }
116+
109117@test " resolve of an unknown name is empty" {
110118 run _project_open_resolve nope
111119 assert_output ' '
@@ -115,7 +123,7 @@ teardown() {
115123 po_refresh
116124 local out
117125 out=" $( _project_open_projects | LC_ALL=C sort | tr ' \n' ' ,' ) "
118- assert_equal " ${out} " " HoldFast,acme,beta,khuey,"
126+ assert_equal " ${out} " " HoldFast,acme,beta,clinimed, khuey,"
119127}
120128
121129@test " targets lists a project's subdirs" {
@@ -164,6 +172,13 @@ teardown() {
164172 assert_equal " ${dir} " " ${ROOT} /wordpress/acme/site"
165173}
166174
175+ @test " project_open descends into bedrock for a nested-git project" {
176+ po_refresh
177+ local dir
178+ dir=" $( cd / && project_open clinimed > /dev/null 2>&1 && pwd) "
179+ assert_equal " ${dir} " " ${ROOT} /wordpress/clinimed/bedrock"
180+ }
181+
167182@test " project_open <name> <subdir> cds into the subdir" {
168183 po_refresh
169184 local dir
0 commit comments