Updates from review · gitpython-developers/GitPython@fd2c6da · GitHub
Skip to content

Commit fd2c6da

Browse files
committed
Updates from review
1 parent e6108c7 commit fd2c6da

3 files changed

Lines changed: 16 additions & 19 deletions

File tree

git/cmd.py

Lines changed: 5 additions & 5 deletions

git/remote.py

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1029,12 +1029,11 @@ def pull(
10291029
self._assert_refspec()
10301030
kwargs = add_progress(kwargs, self.repo.git, progress)
10311031

1032-
if not allow_unsafe_protocols and refspec:
1033-
if isinstance(refspec, str):
1034-
Git.check_unsafe_protocols(refspec)
1035-
else:
1036-
for ref in refspec:
1037-
Git.check_unsafe_protocols(ref)
1032+
refspec = Git._unpack_args(refspec or [])
1033+
if not allow_unsafe_protocols:
1034+
for ref in refspec:
1035+
Git.check_unsafe_protocols(ref)
1036+
10381037
if not allow_unsafe_options:
10391038
Git.check_unsafe_options(options=list(kwargs.keys()), unsafe_options=self.unsafe_git_pull_options)
10401039

@@ -1084,12 +1083,10 @@ def push(
10841083
be 0."""
10851084
kwargs = add_progress(kwargs, self.repo.git, progress)
10861085

1087-
if not allow_unsafe_protocols and refspec:
1088-
if isinstance(refspec, str):
1089-
Git.check_unsafe_protocols(refspec)
1090-
else:
1091-
for ref in refspec:
1092-
Git.check_unsafe_protocols(ref)
1086+
refspec = Git._unpack_args(refspec or [])
1087+
if not allow_unsafe_protocols:
1088+
for ref in refspec:
1089+
Git.check_unsafe_protocols(ref)
10931090

10941091
if not allow_unsafe_options:
10951092
Git.check_unsafe_options(options=list(kwargs.keys()), unsafe_options=self.unsafe_git_push_options)

test/test_git.py

Lines changed: 2 additions & 2 deletions

0 commit comments

Comments
 (0)