Skip to content

Show first seven char of commit hash #566

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

Merged
merged 2 commits into from
Nov 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion app/helpers/pages_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ def git_commit_sha

def git_commit_sha_short
full_sha = git_commit_sha
full_sha[-7..]
full_sha[...7]
end
end
4 changes: 2 additions & 2 deletions spec/system/pages_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

context "when .source_version file does not exist" do
let(:sha) { "94d92356828a56db25fccff9d50f41c525eead5x" }
let(:expected_text) { "5eead5x" }
let(:expected_text) { "94d9235" }

before do
# stub this method since we need to control what the sha actually is
Expand All @@ -31,7 +31,7 @@

context "when .source_version file exists" do
let(:sha) { "94d92356828a56db25fccff9d50f41c525eead5y" }
let(:expected_text) { "5eead5y" }
let(:expected_text) { "94d9235" }

before { `cd #{Rails.root} && echo #{sha} > .source_version` }

Expand Down