Skip to content

Commit

Permalink
Show first seven char of commit hash (#566)
Browse files Browse the repository at this point in the history
* Show first seven char of commit hash

This is to follow the same convention of using commit hash so that in
one glance we can detect if we are the desired commit or not.

* Update tests
  • Loading branch information
ahangarha authored Nov 23, 2023
1 parent 764a299 commit 6625b90
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
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

0 comments on commit 6625b90

Please sign in to comment.