Skip to content

Commit

Permalink
use abspath when specifying repo path to avoid invalid empty path.
Browse files Browse the repository at this point in the history
  • Loading branch information
amueller committed Jan 22, 2024
1 parent 7be9805 commit a1f815c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mlflow/utils/git_utils.py
Expand Up @@ -44,7 +44,7 @@ def get_git_commit(path: str) -> Optional[str]:
return None
try:
if os.path.isfile(path):
path = os.path.dirname(path)
path = os.path.dirname(os.path.abspath(path))
repo = Repo(path, search_parent_directories=True)
if path in repo.ignored(path):
return None
Expand Down

0 comments on commit a1f815c

Please sign in to comment.