Skip to content

Commit adcf329

Browse files
committed
fix(config): search backwards from root_dir when determining vcs_root
1 parent 0a19b4f commit adcf329

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/taskgraph/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ def register(self):
155155
@property
156156
def vcs_root(self):
157157
try:
158-
repo = get_repository(os.getcwd())
158+
repo = get_repository(self.root_dir)
159159
return Path(repo.path)
160160
except RuntimeError:
161161
root = Path(self.root_dir)

test/test_generator.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ def test_load_tasks_for_kind(monkeypatch):
182182
tasks = load_tasks_for_kind(
183183
{"_kinds": [("_example-kind", []), ("docker-image", [])]},
184184
"_example-kind",
185-
"/root",
185+
"/root/taskcluster",
186186
)
187187
assert "docker-image-t-1" not in tasks
188188
assert (
@@ -193,7 +193,7 @@ def test_load_tasks_for_kind(monkeypatch):
193193
tasks = load_tasks_for_kinds(
194194
{"_kinds": [("_example-kind", []), ("docker-image", [])]},
195195
["_example-kind", "docker-image"],
196-
"/root",
196+
"/root/taskcluster",
197197
)
198198
assert (
199199
"docker-image-t-1" in tasks

0 commit comments

Comments
 (0)