@@ -299,10 +299,12 @@ repository_name=github.com/sourcegraph/src-cli`,
299299 ".gitignore" : "node_modules" ,
300300 "message.txt" : "root-dir" ,
301301 "a/message.txt" : "a-dir" ,
302+ "a/.gitignore" : "node_modules-in-a" ,
302303 "a/b/message.txt" : "b-dir" ,
303304 }},
304305 {repo : srcCLIRepo , path : "a" , files : map [string ]string {
305306 "a/message.txt" : "a-dir" ,
307+ "a/.gitignore" : "node_modules-in-a" ,
306308 "a/b/message.txt" : "b-dir" ,
307309 }},
308310 {repo : srcCLIRepo , path : "a/b" , files : map [string ]string {
@@ -311,7 +313,8 @@ repository_name=github.com/sourcegraph/src-cli`,
311313 },
312314 additionalFiles : []mockRepoAdditionalFiles {
313315 {repo : srcCLIRepo , additionalFiles : map [string ]string {
314- ".gitignore" : "node_modules" ,
316+ ".gitignore" : "node_modules" ,
317+ "a/.gitignore" : "node_modules-in-a" ,
315318 }},
316319 },
317320 steps : []Step {
@@ -332,10 +335,15 @@ repository_name=github.com/sourcegraph/src-cli`,
332335 Run : `if [[ $(basename $(pwd)) == "a" && -f "../.gitignore" ]]; then echo "yes" >> gitignore-exists; fi` ,
333336 Container : "doesntmatter:13" ,
334337 },
338+ // In `a/b` we want the `.gitignore` file in the root folder and in `a` to be fetched:
335339 {
336340 Run : `if [[ $(basename $(pwd)) == "b" && -f "../../.gitignore" ]]; then echo "yes" >> gitignore-exists; fi` ,
337341 Container : "doesntmatter:13" ,
338342 },
343+ {
344+ Run : `if [[ $(basename $(pwd)) == "b" && -f "../.gitignore" ]]; then echo "yes" >> gitignore-exists-in-a; fi` ,
345+ Container : "doesntmatter:13" ,
346+ },
339347 },
340348 tasks : []* Task {
341349 {
@@ -361,7 +369,7 @@ repository_name=github.com/sourcegraph/src-cli`,
361369 srcCLIRepo .ID : filesByBranch {
362370 "workspace-root-dir" : []string {"hello.txt" , "gitignore-exists" },
363371 "workspace-a-dir" : []string {"a/hello.txt" , "a/gitignore-exists" },
364- "workspace-b-dir" : []string {"a/b/hello.txt" , "a/b/gitignore-exists" },
372+ "workspace-b-dir" : []string {"a/b/hello.txt" , "a/b/gitignore-exists" , "a/b/gitignore-exists-in-a" },
365373 },
366374 },
367375 },
0 commit comments