Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions fastgit/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

# %% ../nbs/00_core.ipynb #e4c0a290
def callgit(path, *args, split=None, uname=None):
fp = Path(path).resolve()
fp = Path(path).expanduser().resolve()
args = ['git', '-C', str(fp)] + list(args)
if uname: args = ['/usr/bin/sudo', '-u', uname] + args
res = subprocess.run(args, capture_output=True, text=True, check=True).stdout.strip()
Expand All @@ -27,7 +27,7 @@ def get_top(folder):

# %% ../nbs/00_core.ipynb #97f78839
class Git:
def __init__(self, d): self.d = Path(d)
def __init__(self, d): self.d = Path(d).expanduser()

def __call__(self, cmd, *args, split=None, mute_errors=False, **kwargs):
paths = [str(p) for p in listify(kwargs.pop('__', None) or [])]
Expand Down
4 changes: 2 additions & 2 deletions nbs/00_core.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"source": [
"#| export\n",
"def callgit(path, *args, split=None, uname=None):\n",
" fp = Path(path).resolve()\n",
" fp = Path(path).expanduser().resolve()\n",
" args = ['git', '-C', str(fp)] + list(args)\n",
" if uname: args = ['/usr/bin/sudo', '-u', uname] + args\n",
" res = subprocess.run(args, capture_output=True, text=True, check=True).stdout.strip()\n",
Expand Down Expand Up @@ -115,7 +115,7 @@
"source": [
"#| export\n",
"class Git:\n",
" def __init__(self, d): self.d = Path(d)\n",
" def __init__(self, d): self.d = Path(d).expanduser()\n",
"\n",
" def __call__(self, cmd, *args, split=None, mute_errors=False, **kwargs):\n",
" paths = [str(p) for p in listify(kwargs.pop('__', None) or [])]\n",
Expand Down