Skip to content

Commit 1d6070a

Browse files
committed
refactor(git.cmd): Fix param entry (backport from #360)
1 parent d100a1b commit 1d6070a

File tree

1 file changed

+27
-27
lines changed

1 file changed

+27
-27
lines changed

libvcs/cmd/git.py

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -149,15 +149,15 @@ def run(
149149
if cwd is not None:
150150
cli_args.append(f"-C {cwd}")
151151
if git_dir is not None:
152-
cli_args.append(f"--git-dir {git_dir}")
152+
cli_args.extend(["--git-dir", str(git_dir)])
153153
if work_tree is not None:
154-
cli_args.append(f"--work-tree {work_tree}")
154+
cli_args.extend(["--work-tree", str(work_tree)])
155155
if namespace is not None:
156-
cli_args.append(f"--namespace {namespace}")
156+
cli_args.extend(["--namespace", namespace])
157157
if super_prefix is not None:
158-
cli_args.append(f"--super-prefix {super_prefix}")
158+
cli_args.extend(["--super-prefix", super_prefix])
159159
if exec_path is not None:
160-
cli_args.append(f"--exec-path {exec_path}")
160+
cli_args.extend(["--exec-path", exec_path])
161161
if bare is True:
162162
cli_args.append("--bare")
163163
if no_replace_objects is True:
@@ -245,25 +245,25 @@ def clone(
245245
if (filter := kwargs.pop("filter", None)) is not None:
246246
local_flags.append(f"--filter={filter}")
247247
if depth is not None:
248-
local_flags.append(f"--depth {depth}")
248+
local_flags.extend(["--depth", depth])
249249
if branch is not None:
250-
local_flags.append(f"--branch {branch}")
250+
local_flags.extend(["--branch", branch])
251251
if origin is not None:
252-
local_flags.append(f"--origin {origin}")
252+
local_flags.extend(["--origin", origin])
253253
if upload_pack is not None:
254-
local_flags.append(f"--upload-pack {upload_pack}")
254+
local_flags.extend(["--upload-pack", upload_pack])
255255
if shallow_since is not None:
256256
local_flags.append(f"--shallow-since={shallow_since}")
257257
if shallow_exclude is not None:
258258
local_flags.append(f"--shallow-exclude={shallow_exclude}")
259259
if reference is not None:
260-
local_flags.append(f"--reference {reference}")
260+
local_flags.extend(["--reference", reference])
261261
if reference_if_able is not None:
262-
local_flags.append(f"--reference {reference_if_able}")
262+
local_flags.extend(["--reference", reference_if_able])
263263
if server_option is not None:
264264
local_flags.append(f"--server-option={server_option}")
265265
if jobs is not None:
266-
local_flags.append(f"--jobs {jobs}")
266+
local_flags.extend(["--jobs", jobs])
267267
if local is True:
268268
local_flags.append("--local")
269269
if hardlinks is True:
@@ -382,21 +382,21 @@ def fetch(
382382
if (filter := kwargs.pop("filter", None)) is not None:
383383
local_flags.append(f"--filter={filter}")
384384
if depth is not None:
385-
local_flags.append(f"--depth {depth}")
385+
local_flags.extend(["--depth", depth])
386386
if branch is not None:
387-
local_flags.append(f"--branch {branch}")
387+
local_flags.extend(["--branch", branch])
388388
if origin is not None:
389-
local_flags.append(f"--origin {origin}")
389+
local_flags.extend(["--origin", origin])
390390
if upload_pack is not None:
391-
local_flags.append(f"--upload-pack {upload_pack}")
391+
local_flags.extend(["--upload-pack", upload_pack])
392392
if shallow_since is not None:
393393
local_flags.append(f"--shallow-since={shallow_since}")
394394
if shallow_exclude is not None:
395395
local_flags.append(f"--shallow-exclude={shallow_exclude}")
396396
if server_option is not None:
397397
local_flags.append(f"--server-option={server_option}")
398398
if jobs is not None:
399-
local_flags.append(f"--jobs {jobs}")
399+
local_flags.extend(["--jobs", jobs])
400400
if keep:
401401
local_flags.append("--keep")
402402
if force:
@@ -548,12 +548,12 @@ def rebase(
548548
if branch:
549549
required_flags.insert(0, branch)
550550
if onto:
551-
local_flags.append(f"--onto {onto}")
551+
local_flags.extend(["--onto", onto])
552552
if context:
553-
local_flags.append(f"--C{context}")
553+
local_flags.extend(["--C", context])
554554

555555
if exec:
556-
local_flags.append(f"--exec {shlex.quote(exec)}")
556+
local_flags.extend(["--exec", shlex.quote(exec)])
557557
if reschedule_failed_exec:
558558
local_flags.append("--reschedule-failed-exec")
559559
if no_reschedule_failed_exec:
@@ -856,21 +856,21 @@ def pull(
856856
if (filter := kwargs.pop("filter", None)) is not None:
857857
local_flags.append(f"--filter={filter}")
858858
if depth is not None:
859-
local_flags.append(f"--depth {depth}")
859+
local_flags.extend(["--depth", depth])
860860
if branch is not None:
861-
local_flags.append(f"--branch {branch}")
861+
local_flags.extend(["--branch", branch])
862862
if origin is not None:
863-
local_flags.append(f"--origin {origin}")
863+
local_flags.extend(["--origin", origin])
864864
if upload_pack is not None:
865-
local_flags.append(f"--upload-pack {upload_pack}")
865+
local_flags.extend(["--upload-pack", upload_pack])
866866
if shallow_since is not None:
867867
local_flags.append(f"--shallow-since={shallow_since}")
868868
if shallow_exclude is not None:
869869
local_flags.append(f"--shallow-exclude={shallow_exclude}")
870870
if server_option is not None:
871871
local_flags.append(f"--server-option={server_option}")
872872
if jobs is not None:
873-
local_flags.append(f"--jobs {jobs}")
873+
local_flags.extend(["--jobs", jobs])
874874
if keep:
875875
local_flags.append("--keep")
876876
if force:
@@ -998,9 +998,9 @@ def init(
998998
if object_format is not None:
999999
local_flags.append(f"--object-format={object_format}")
10001000
if branch is not None:
1001-
local_flags.append(f"--branch {branch}")
1001+
local_flags.extend(["--branch", branch])
10021002
if initial_branch is not None:
1003-
local_flags.append(f"--initial-branch {initial_branch}")
1003+
local_flags.extend(["--initial-branch", initial_branch])
10041004
if shared is True:
10051005
local_flags.append("--shared")
10061006
if quiet is True:

0 commit comments

Comments
 (0)