Skip to content

Commit

Permalink
fix issue with partial branch match
Browse files Browse the repository at this point in the history
  • Loading branch information
jedwards4b committed Oct 30, 2023
1 parent 7b6d92e commit c3cf3ec
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions manic/repository_git.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,8 +380,8 @@ 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
print(f"is_tag {is_tag} is_branch {is_branch} is_valid {is_valid}")
if not is_valid:
msg = ('In repo "{0}": reference "{1}" does not appear to be a '
'valid tag, branch or hash! Please verify the reference '
Expand Down Expand Up @@ -710,7 +710,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 c3cf3ec

Please sign in to comment.