mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Allow for git worktree when computing clangtidy scm root (#123060)
When you make a git worktree, the .git "folder" in the worktree is not a directory, it's a file pointing at the actual .git directory. Signed-off-by: Edward Z. Yang <ezyang@meta.com> Pull Request resolved: https://github.com/pytorch/pytorch/pull/123060 Approved by: https://github.com/albanD
This commit is contained in:
committed by
PyTorch MergeBot
parent
0fd072bf90
commit
0d3a771f7b
@ -18,7 +18,7 @@ from typing import Any, List, NamedTuple, Optional, Pattern
|
||||
def scm_root() -> str:
|
||||
path = os.path.abspath(os.getcwd())
|
||||
while True:
|
||||
if os.path.isdir(os.path.join(path, ".git")):
|
||||
if os.path.exists(os.path.join(path, ".git")):
|
||||
return path
|
||||
if os.path.isdir(os.path.join(path, ".hg")):
|
||||
return path
|
||||
|
Reference in New Issue
Block a user