Skip to content

Commit

Permalink
fix: πŸ› Fix for git dubious ownership messages
Browse files Browse the repository at this point in the history
  • Loading branch information
robvanderleek committed Dec 16, 2024
1 parent b78b17b commit 545f0fc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions codelimit/common/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,15 +207,15 @@ def replace_string_literal_with_predicate(expression: Expression) -> Expression:

def _get_git_branch(path: Path) -> str | None:
try:
out = sh.git('rev-parse', '--abbrev-ref', 'HEAD', _cwd=path)
out = sh.git('-c', f'safe.directory={path.resolve()}', 'rev-parse', '--abbrev-ref', 'HEAD', _cwd=path)
return out.strip()
except sh.ErrorReturnCode | sh.CommandNotFound:
return None


def _get_remote_url(path: Path) -> str | None:
try:
out = sh.git('config', '--get', 'remote.origin.url', _cwd=path)
out = sh.git('-c', f'safe.directory={path.resolve()}', 'config', '--get', 'remote.origin.url', _cwd=path)
return out.strip()
except sh.ErrorReturnCode | sh.CommandNotFound:
return None
Expand Down

0 comments on commit 545f0fc

Please sign in to comment.