diff options
author | Santos Gallegos <stsewd@proton.me> | 2022-12-27 16:56:43 -0500 |
---|---|---|
committer | Santos Gallegos <stsewd@proton.me> | 2022-12-27 16:56:43 -0500 |
commit | fd2c6da5f82009398d241dc07603fbcd490ced29 (patch) | |
tree | 9c83a970c472af64fe8acd4f7b0386858e684f0e /git/remote.py | |
parent | e6108c7997f5c8f7361b982959518e982b973230 (diff) | |
download | gitpython-fd2c6da5f82009398d241dc07603fbcd490ced29.tar.gz |
Updates from review
Diffstat (limited to 'git/remote.py')
-rw-r--r-- | git/remote.py | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/git/remote.py b/git/remote.py index 1eff00b9..520544b6 100644 --- a/git/remote.py +++ b/git/remote.py @@ -1029,12 +1029,11 @@ class Remote(LazyMixin, IterableObj): self._assert_refspec() kwargs = add_progress(kwargs, self.repo.git, progress) - if not allow_unsafe_protocols and refspec: - if isinstance(refspec, str): - Git.check_unsafe_protocols(refspec) - else: - for ref in refspec: - Git.check_unsafe_protocols(ref) + refspec = Git._unpack_args(refspec or []) + if not allow_unsafe_protocols: + for ref in refspec: + Git.check_unsafe_protocols(ref) + if not allow_unsafe_options: Git.check_unsafe_options(options=list(kwargs.keys()), unsafe_options=self.unsafe_git_pull_options) @@ -1084,12 +1083,10 @@ class Remote(LazyMixin, IterableObj): be 0.""" kwargs = add_progress(kwargs, self.repo.git, progress) - if not allow_unsafe_protocols and refspec: - if isinstance(refspec, str): - Git.check_unsafe_protocols(refspec) - else: - for ref in refspec: - Git.check_unsafe_protocols(ref) + refspec = Git._unpack_args(refspec or []) + if not allow_unsafe_protocols: + for ref in refspec: + Git.check_unsafe_protocols(ref) if not allow_unsafe_options: Git.check_unsafe_options(options=list(kwargs.keys()), unsafe_options=self.unsafe_git_push_options) |