Lines Matching refs:path
21 _path = os.path.realpath(__file__ + '/../..')
22 if sys.path[0] != _path:
23 sys.path.insert(0, _path)
92 def get_file_content(commit, path): argument
132 def raw_diff(path, target): argument
145 diff = rh.utils.run(cmd, cwd=path, capture_output=True).stdout
184 def find_repo_root(path=None, outer=False): argument
190 if path is None:
191 path = os.getcwd()
192 orig_path = path
194 path = os.path.abspath(path)
200 git_worktree_path = rh.utils.run(cmd, cwd=path, capture_output=True).stdout.strip()
204 while not os.path.exists(os.path.join(path, '.repo')):
205 path = os.path.dirname(path)
206 if path == '/':
209 root = path
210 if not outer and os.path.isdir(os.path.join(root, '.repo', 'submanifests')):
213 abs_orig_path = os.path.abspath(orig_path)
214 parts = os.path.relpath(abs_orig_path, root).split(os.path.sep)
215 while parts and not os.path.isdir(
216 os.path.join(root, '.repo', 'submanifests', *parts, 'manifests')):
218 path = os.path.join(root, *parts)
220 return path
223 def is_git_repository(path): argument
225 cmd = ['git', 'rev-parse', '--resolve-git-dir', os.path.join(path, '.git')]