Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Fixed another "source and destination both remote" error case. (Windows) #62

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
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
10 changes: 6 additions & 4 deletions git_fat/git_fat.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,11 +371,13 @@ def __init__(self, base_dir, **kwargs):
self.ssh_port = ssh_port
self.base_dir = base_dir
# Swap Windows style drive letters (e.g. 't:') for cygwin style drive letters (e.g. '/t')
# Otherwise, when using an rsyncd remote (e.g. 'example.org::bin'),
# The rsync client on Windows will exit with this error:
# Otherwise, when using certain rsync remotes, the rsync client on Windows will exit with this error:
# "The source and destination cannot both be remote."
# Presumably, this is because rsync assumes any path is remote if it contains a colon.
if platform.system() == 'Windows' and self.is_rsyncd_remote and self.base_dir.find(':') == 1:
# Presumably, this is because rsync assumes a path is remote if it contains a colon.
# Examples of bad double colon situations that can cause this:
# Local path is "c:/some/path" and remote is "example.org:/some/path" (ssh remote)
# Local path is "c:/some/path" and remote is "example.org::bin" (rsyncd remote)
if platform.system() == 'Windows' and self.base_dir.find(':') == 1:
self.base_dir = "/" + self.base_dir[0] + self.base_dir[2:]

def _rsync(self, push):
Expand Down