Skip to content

Commit 5707ec6

Browse files
committed
cmd/git(fix[Git.fetch,Git.pull]): Remove clone-only branch/origin params
why: The --branch and --origin flags only exist for git clone, not for git fetch or git pull. Using these parameters would cause git to fail with "unknown option 'branch'" or "unknown option 'origin'". what: - Remove branch and origin parameters from fetch() signature - Remove branch and origin parameters from pull() signature - Remove implementation code that emitted these invalid flags
1 parent 9eec47c commit 5707ec6

1 file changed

Lines changed: 0 additions & 12 deletions

File tree

src/libvcs/cmd/git.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -423,8 +423,6 @@ def fetch(
423423
reftag: t.Any | None = None,
424424
deepen: str | None = None,
425425
depth: str | None = None,
426-
branch: str | None = None,
427-
origin: str | None = None,
428426
upload_pack: str | None = None,
429427
shallow_since: str | None = None,
430428
shallow_exclude: str | None = None,
@@ -496,10 +494,6 @@ def fetch(
496494
local_flags.append(f"--filter={_filter}")
497495
if depth is not None:
498496
local_flags.extend(["--depth", depth])
499-
if branch is not None:
500-
local_flags.extend(["--branch", branch])
501-
if origin is not None:
502-
local_flags.extend(["--origin", origin])
503497
if upload_pack is not None:
504498
local_flags.extend(["--upload-pack", upload_pack])
505499
if shallow_since is not None:
@@ -780,8 +774,6 @@ def pull(
780774
repository: str | None = None,
781775
deepen: str | None = None,
782776
depth: str | None = None,
783-
branch: str | None = None,
784-
origin: str | None = None,
785777
upload_pack: str | None = None,
786778
shallow_since: str | None = None,
787779
shallow_exclude: str | None = None,
@@ -975,10 +967,6 @@ def pull(
975967
local_flags.append(f"--filter={_filter}")
976968
if depth is not None:
977969
local_flags.extend(["--depth", depth])
978-
if branch is not None:
979-
local_flags.extend(["--branch", branch])
980-
if origin is not None:
981-
local_flags.extend(["--origin", origin])
982970
if upload_pack is not None:
983971
local_flags.extend(["--upload-pack", upload_pack])
984972
if shallow_since is not None:

0 commit comments

Comments
 (0)