If redo searched all the way up to /default.do, it would run ./default.do instead.

This only happened if the containing project was buggy, ie. you tried
to build a target that has no .do file available anywhere. However, it
resulted in a confusing outcome for that case, where we'd run the wrong
default.do file with the wrong parameters.

Extended an existing test to catch this mistake.
This commit is contained in:
Avery Pennarun 2019-03-02 02:53:02 -05:00
commit e5a27f04e8
4 changed files with 18 additions and 4 deletions

View file

@ -32,7 +32,7 @@ def possible_do_files(t):
# since t is an absolute path, dirbits[0] is always '', so we don't
# need to count all the way down to i=0.
for i in range(len(dirbits), 0, -1):
basedir = '/'.join(dirbits[:i])
basedir = '/'.join(dirbits[:i]) or '/'
subdir = '/'.join(dirbits[i:])
for dofile, basename, ext in _default_do_files(filename):
yield (basedir, dofile,