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

Ensure branch exists locally and remotely before comparing it #677

Merged
merged 3 commits into from
Aug 12, 2021
Merged
Changes from 1 commit
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
Next Next commit
Add spec for git:ensure_pushed task
lovro-bikic committed Aug 12, 2021

Verified

This commit was signed with the committer’s verified signature.
lovro-bikic Lovro Bikić
commit 23de88400e39d9217de8f9050680bedcdd279848
5 changes: 5 additions & 0 deletions spec/support/outputs/git_ensure_pushed.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
echo "-----> Ensuring everything is pushed to git"
if \[ \$\(git log origin/master..master \| wc -l\) -ne 0 \]; then
echo "! Your branch master needs to be pushed to origin before deploying"
exit 1
fi
6 changes: 6 additions & 0 deletions spec/tasks/git_spec.rb
Original file line number Diff line number Diff line change
@@ -18,4 +18,10 @@
expect { invoke_all }.to output(output_file('git_revision')).to_stdout
end
end

describe 'git:ensure_pushed' do
it 'git ensure pushed' do
expect { invoke_all }.to output(output_file('git_ensure_pushed')).to_stdout
end
end
end