@@ -44,6 +44,7 @@ def run(
44
44
man_path : Optional [bool ] = None ,
45
45
info_path : Optional [bool ] = None ,
46
46
# Normal flags
47
+ C : Optional [Union [StrOrBytesPath , list [StrOrBytesPath ]]] = None ,
47
48
cwd : Optional [StrOrBytesPath ] = None ,
48
49
git_dir : Optional [StrOrBytesPath ] = None ,
49
50
work_tree : Optional [StrOrBytesPath ] = None ,
@@ -71,8 +72,10 @@ def run(
71
72
72
73
Parameters
73
74
----------
74
- cwd : :attr:`libvcs.cmd.types.StrOrBytesPath`, optional
75
- ``-C <path>``, Defaults to :attr:`~.cwd`
75
+ cwd : :attr:`libvcs.cmd.types.StrOrBytesPath`, optional, passed to subprocess's
76
+ ``cwd`` the command runs from. Defaults to :attr:`~.cwd`.
77
+ C : :attr:`libvcs.cmd.types.StrOrBytesPath`, optional
78
+ ``-C <path>``
76
79
git_dir : :attr:`libvcs.cmd.types.StrOrBytesPath`, optional
77
80
``--git-dir <path>``
78
81
work_tree : :attr:`libvcs.cmd.types.StrOrBytesPath`, optional
@@ -148,8 +151,11 @@ def run(
148
151
#
149
152
# Flags
150
153
#
151
- if cwd is not None :
152
- cli_args .append (f"-C { cwd } " )
154
+ if C is not None :
155
+ if not isinstance (C , list ):
156
+ C = [C ]
157
+ C = [str (c ) for c in C ]
158
+ cli_args .extend (["-C" , C ])
153
159
if git_dir is not None :
154
160
cli_args .append (f"--git-dir { git_dir } " )
155
161
if work_tree is not None :
@@ -1384,6 +1390,9 @@ def status(
1384
1390
1385
1391
>>> git.status(porcelain='2')
1386
1392
'? new_file.txt'
1393
+
1394
+ >>> git.status(C=git_local_clone.dir / '.git', porcelain='2')
1395
+ '? new_file.txt'
1387
1396
"""
1388
1397
local_flags : list [str ] = []
1389
1398
0 commit comments