Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

vcs: Improve git parameters handling #7338

Merged
merged 1 commit into from
Mar 3, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions weblate/vcs/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def get_remote_branch(cls, repo: str):
if not repo:
return super().get_remote_branch(repo)
try:
result = cls._popen(["ls-remote", "--symref", repo, "HEAD"])
result = cls._popen(["ls-remote", "--symref", "--", repo, "HEAD"])
except RepositoryException:
report_error(cause="Listing remote branch")
return super().get_remote_branch(repo)
Expand Down Expand Up @@ -149,7 +149,9 @@ def get_depth():
@classmethod
def _clone(cls, source: str, target: str, branch: str):
"""Clone repository."""
cls._popen(["clone"] + cls.get_depth() + ["--branch", branch, source, target])
cls._popen(
["clone"] + cls.get_depth() + ["--branch", branch, "--", source, target]
)

def get_config(self, path):
"""Read entry from configuration."""
Expand Down Expand Up @@ -572,7 +574,7 @@ def get_last_repo_revision(cls, url):

@classmethod
def get_remote_args(cls, source, target):
result = ["--prefix=origin/", source, target]
result = ["--prefix=origin/", "--", source, target]
if cls.is_stdlayout(source):
result.insert(0, "--stdlayout")
revision = cls.get_last_repo_revision(source + "/trunk/")
Expand Down