Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit 7e79162

Browse files
committed
Bug 1942210 - Simplify gecko_taskgraph.util.get_file_finder. r=taskgraph-reviewers,jcristau
- get_repository_object takes a string or a Path, but that makes no difference, so the second call doesn't need the explicit Path conversion. - repo.get_tracked_files_finder either returns something or None, so the first branch can be simplified to return repo.get_tracked_files_finder() - then we can obviously see branches are just the same thing. Differential Revision: https://phabricator.services.mozilla.com/D234631
1 parent 819432c commit 7e79162

File tree

1 file changed

+1
-13
lines changed
  • taskcluster/gecko_taskgraph/util

1 file changed

+1
-13
lines changed

taskcluster/gecko_taskgraph/util/hash.py

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,7 @@ def hash_path(path):
2121

2222
@memoize
2323
def get_file_finder(base_path):
24-
from pathlib import Path
25-
26-
repo = get_repository_object(base_path)
27-
if repo:
28-
files = repo.get_tracked_files_finder(base_path)
29-
if files:
30-
return files
31-
else:
32-
return None
33-
else:
34-
return get_repository_object(Path(base_path)).get_tracked_files_finder(
35-
base_path
36-
)
24+
return get_repository_object(base_path).get_tracked_files_finder(base_path)
3725

3826

3927
def hash_paths(base_path, patterns):

0 commit comments

Comments
 (0)