Skip to content

Commit

Permalink
GitBundleRepository._ship: bundle everything and ignore remote head i…
Browse files Browse the repository at this point in the history
…f current head is not in local branch
  • Loading branch information
elikoga committed Oct 29, 2024
1 parent 42ae016 commit b8b996d
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/batou/repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,13 +386,20 @@ def _ship(self, host):
class GitBundleRepository(GitRepository):
def _ship(self, host):
head = host.rpc.git_current_head()
if head:
# check if head is in local branch, if not, bundle everything and ignore remote head
try:
cmd(
f"git branch {self.branch} --contains {head}",
acceptable_returncodes=[0],
)
except CmdExecutionError:
head = None
if head is None:
bundle_range = self.branch
else:
head = head.decode("ascii")
bundle_range = "{head}..{branch}".format(
head=head, branch=self.branch
)
bundle_range = f"{head}..{self.branch}"
fd, bundle_file = tempfile.mkstemp()
os.close(fd)
try:
Expand Down

0 comments on commit b8b996d

Please sign in to comment.