Skip to content

Commit

Permalink
Merge pull request #201 from jedwards4b/partial_match
Browse files Browse the repository at this point in the history
fix issue with partial branch match
  • Loading branch information
jedwards4b authored Oct 30, 2023
2 parents 7b6d92e + b4466a5 commit 38bcc0a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions manic/repository_git.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,6 @@ def _check_for_valid_ref(self, ref, remote_name, dirname):
is_tag = self._ref_is_tag(ref, dirname)
is_branch = self._ref_is_branch(ref, remote_name, dirname)
is_hash = self._ref_is_hash(ref, dirname)

is_valid = is_tag or is_branch or is_hash
if not is_valid:
msg = ('In repo "{0}": reference "{1}" does not appear to be a '
Expand Down Expand Up @@ -710,7 +709,10 @@ def _git_lsremote_branch(ref, remote_name, dirname):
cmd = ('git -C {dirname} ls-remote --exit-code --heads '
'{remote_name} {ref}').format(
dirname=dirname, remote_name=remote_name, ref=ref).split()
status = execute_subprocess(cmd, status_to_caller=True)
status, output = execute_subprocess(cmd, status_to_caller=True, output_to_caller=True)
if not status and not f"refs/heads/{ref}" in output:
# In this case the ref is contained in the branch name but is not the complete branch name
return -1
return status

@staticmethod
Expand Down

0 comments on commit 38bcc0a

Please sign in to comment.