@@ -157,15 +157,15 @@ def run(
157
157
C = [str (c ) for c in C ]
158
158
cli_args .extend (["-C" , C ])
159
159
if git_dir is not None :
160
- cli_args .append ( f "--git-dir { git_dir } " )
160
+ cli_args .extend ([ "--git-dir" , str ( git_dir )] )
161
161
if work_tree is not None :
162
- cli_args .append ( f "--work-tree { work_tree } " )
162
+ cli_args .extend ([ "--work-tree" , str ( work_tree )] )
163
163
if namespace is not None :
164
- cli_args .append ( f "--namespace { namespace } " )
164
+ cli_args .extend ([ "--namespace" , namespace ] )
165
165
if super_prefix is not None :
166
- cli_args .append ( f "--super-prefix { super_prefix } " )
166
+ cli_args .extend ([ "--super-prefix" , super_prefix ] )
167
167
if exec_path is not None :
168
- cli_args .append ( f "--exec-path { exec_path } " )
168
+ cli_args .extend ([ "--exec-path" , exec_path ] )
169
169
if bare is True :
170
170
cli_args .append ("--bare" )
171
171
if no_replace_objects is True :
@@ -253,25 +253,25 @@ def clone(
253
253
if (filter := kwargs .pop ("filter" , None )) is not None :
254
254
local_flags .append (f"--filter={ filter } " )
255
255
if depth is not None :
256
- local_flags .append ( f "--depth { depth } " )
256
+ local_flags .extend ([ "--depth" , depth ] )
257
257
if branch is not None :
258
- local_flags .append ( f "--branch { branch } " )
258
+ local_flags .extend ([ "--branch" , branch ] )
259
259
if origin is not None :
260
- local_flags .append ( f "--origin { origin } " )
260
+ local_flags .extend ([ "--origin" , origin ] )
261
261
if upload_pack is not None :
262
- local_flags .append ( f "--upload-pack { upload_pack } " )
262
+ local_flags .extend ([ "--upload-pack" , upload_pack ] )
263
263
if shallow_since is not None :
264
264
local_flags .append (f"--shallow-since={ shallow_since } " )
265
265
if shallow_exclude is not None :
266
266
local_flags .append (f"--shallow-exclude={ shallow_exclude } " )
267
267
if reference is not None :
268
- local_flags .append ( f "--reference { reference } " )
268
+ local_flags .extend ([ "--reference" , reference ] )
269
269
if reference_if_able is not None :
270
- local_flags .append ( f "--reference { reference_if_able } " )
270
+ local_flags .extend ([ "--reference" , reference_if_able ] )
271
271
if server_option is not None :
272
272
local_flags .append (f"--server-option={ server_option } " )
273
273
if jobs is not None :
274
- local_flags .append ( f "--jobs { jobs } " )
274
+ local_flags .extend ([ "--jobs" , jobs ] )
275
275
if local is True :
276
276
local_flags .append ("--local" )
277
277
if hardlinks is True :
@@ -390,21 +390,21 @@ def fetch(
390
390
if (filter := kwargs .pop ("filter" , None )) is not None :
391
391
local_flags .append (f"--filter={ filter } " )
392
392
if depth is not None :
393
- local_flags .append ( f "--depth { depth } " )
393
+ local_flags .extend ([ "--depth" , depth ] )
394
394
if branch is not None :
395
- local_flags .append ( f "--branch { branch } " )
395
+ local_flags .extend ([ "--branch" , branch ] )
396
396
if origin is not None :
397
- local_flags .append ( f "--origin { origin } " )
397
+ local_flags .extend ([ "--origin" , origin ] )
398
398
if upload_pack is not None :
399
- local_flags .append ( f "--upload-pack { upload_pack } " )
399
+ local_flags .extend ([ "--upload-pack" , upload_pack ] )
400
400
if shallow_since is not None :
401
401
local_flags .append (f"--shallow-since={ shallow_since } " )
402
402
if shallow_exclude is not None :
403
403
local_flags .append (f"--shallow-exclude={ shallow_exclude } " )
404
404
if server_option is not None :
405
405
local_flags .append (f"--server-option={ server_option } " )
406
406
if jobs is not None :
407
- local_flags .append ( f "--jobs { jobs } " )
407
+ local_flags .extend ([ "--jobs" , jobs ] )
408
408
if keep :
409
409
local_flags .append ("--keep" )
410
410
if force :
@@ -556,12 +556,12 @@ def rebase(
556
556
if branch :
557
557
required_flags .insert (0 , branch )
558
558
if onto :
559
- local_flags .append ( f "--onto { onto } " )
559
+ local_flags .extend ([ "--onto" , onto ] )
560
560
if context :
561
- local_flags .append ( f "--C{ context } " )
561
+ local_flags .extend ([ "--C" , context ] )
562
562
563
563
if exec :
564
- local_flags .append ( f "--exec { shlex .quote (exec )} " )
564
+ local_flags .extend ([ "--exec" , shlex .quote (exec )] )
565
565
if reschedule_failed_exec :
566
566
local_flags .append ("--reschedule-failed-exec" )
567
567
if no_reschedule_failed_exec :
@@ -864,21 +864,21 @@ def pull(
864
864
if (filter := kwargs .pop ("filter" , None )) is not None :
865
865
local_flags .append (f"--filter={ filter } " )
866
866
if depth is not None :
867
- local_flags .append ( f "--depth { depth } " )
867
+ local_flags .extend ([ "--depth" , depth ] )
868
868
if branch is not None :
869
- local_flags .append ( f "--branch { branch } " )
869
+ local_flags .extend ([ "--branch" , branch ] )
870
870
if origin is not None :
871
- local_flags .append ( f "--origin { origin } " )
871
+ local_flags .extend ([ "--origin" , origin ] )
872
872
if upload_pack is not None :
873
- local_flags .append ( f "--upload-pack { upload_pack } " )
873
+ local_flags .extend ([ "--upload-pack" , upload_pack ] )
874
874
if shallow_since is not None :
875
875
local_flags .append (f"--shallow-since={ shallow_since } " )
876
876
if shallow_exclude is not None :
877
877
local_flags .append (f"--shallow-exclude={ shallow_exclude } " )
878
878
if server_option is not None :
879
879
local_flags .append (f"--server-option={ server_option } " )
880
880
if jobs is not None :
881
- local_flags .append ( f "--jobs { jobs } " )
881
+ local_flags .extend ([ "--jobs" , jobs ] )
882
882
if keep :
883
883
local_flags .append ("--keep" )
884
884
if force :
@@ -1006,9 +1006,9 @@ def init(
1006
1006
if object_format is not None :
1007
1007
local_flags .append (f"--object-format={ object_format } " )
1008
1008
if branch is not None :
1009
- local_flags .append ( f "--branch { branch } " )
1009
+ local_flags .extend ([ "--branch" , branch ] )
1010
1010
if initial_branch is not None :
1011
- local_flags .append ( f "--initial-branch { initial_branch } " )
1011
+ local_flags .extend ([ "--initial-branch" , initial_branch ] )
1012
1012
if shared is True :
1013
1013
local_flags .append ("--shared" )
1014
1014
if quiet is True :
@@ -1156,7 +1156,7 @@ def reset(
1156
1156
local_flags .append ("--no-refresh" )
1157
1157
if refresh is True :
1158
1158
local_flags .append ("--refresh" )
1159
- if pathspec_from_file is True :
1159
+ if pathspec_from_file is not None :
1160
1160
local_flags .append (f"--pathspec_from_file { pathspec_from_file } " )
1161
1161
1162
1162
# HEAD to commit form
@@ -1176,7 +1176,7 @@ def reset(
1176
1176
local_flags .append ("--keep" )
1177
1177
1178
1178
if commit is True :
1179
- local_flags .append (f" { commit } " )
1179
+ local_flags .append (commit )
1180
1180
1181
1181
if recurse_submodules :
1182
1182
local_flags .append ("--recurse-submodules" )
@@ -1297,19 +1297,19 @@ def checkout(
1297
1297
local_flags .append (f"--conflict={ conflict } " )
1298
1298
1299
1299
if commit is True :
1300
- local_flags .append (f" { commit } " )
1300
+ local_flags .append (commit )
1301
1301
1302
1302
if branch is True :
1303
- local_flags .append (f" { branch } " )
1303
+ local_flags .append (branch )
1304
1304
1305
1305
if new_branch is True :
1306
- local_flags .append (f" { new_branch } " )
1306
+ local_flags .append (new_branch )
1307
1307
1308
1308
if start_point is True :
1309
- local_flags .append (f" { start_point } " )
1309
+ local_flags .append (start_point )
1310
1310
1311
1311
if treeish is True :
1312
- local_flags .append (f" { treeish } " )
1312
+ local_flags .append (treeish )
1313
1313
1314
1314
if recurse_submodules :
1315
1315
local_flags .append ("--recurse-submodules" )
@@ -1438,7 +1438,10 @@ def status(
1438
1438
local_flags .append ("--porcelain" )
1439
1439
1440
1440
if find_renames is True :
1441
- local_flags .append (f"--find-renames={ find_renames } " )
1441
+ if isinstance (find_renames , str ):
1442
+ local_flags .append (f"--find-renames={ find_renames } " )
1443
+ else :
1444
+ local_flags .append ("--find-renames" )
1442
1445
1443
1446
if pathspec is not None :
1444
1447
if not isinstance (pathspec , list ):
0 commit comments