Skip to content

Commit

Permalink
Fix ddev testable command to properly use the tag (and fallback on th…
Browse files Browse the repository at this point in the history
…e branch if absent). (#4775)
  • Loading branch information
remeh authored and FlorianVeaux committed Oct 15, 2019
1 parent 378a714 commit db9ba72
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -283,11 +283,14 @@ def testable(ctx, start_id, agent_version, milestone, dry_run):
echo_info('Branch `{}` will be compared to `master`.'.format(current_release_branch))

echo_waiting('Getting diff... ', nl=False)
diif_command = 'git --no-pager log "--pretty=format:%H %s" {}..master'
diff_command = 'git --no-pager log "--pretty=format:%H %s" {}..master'

with chdir(root):
result = run_command(diif_command.format(current_release_branch), capture=True)
# compare with the local tag first
reftag = '{}{}'.format('refs/tags/', current_release_branch)
result = run_command(diff_command.format(reftag), capture=True)
if result.code:
# if it didn't work, compare with a branch.
origin_release_branch = 'origin/{}'.format(current_release_branch)
echo_failure('failed!')
echo_waiting(
Expand All @@ -297,9 +300,9 @@ def testable(ctx, start_id, agent_version, milestone, dry_run):
nl=False,
)

result = run_command(diif_command.format(origin_release_branch), capture=True)
result = run_command(diff_command.format(origin_release_branch), capture=True)
if result.code:
abort('Unable to get the diif.')
abort('Unable to get the diff.')
else:
echo_success('success!')
else:
Expand Down

0 comments on commit db9ba72

Please sign in to comment.