Skip to content

Commit 6625b90

Browse files
authored
Show first seven char of commit hash (#566)
* 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
1 parent 764a299 commit 6625b90

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Diff for: app/helpers/pages_helper.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ def git_commit_sha
77

88
def git_commit_sha_short
99
full_sha = git_commit_sha
10-
full_sha[-7..]
10+
full_sha[...7]
1111
end
1212
end

Diff for: spec/system/pages_spec.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
context "when .source_version file does not exist" do
2121
let(:sha) { "94d92356828a56db25fccff9d50f41c525eead5x" }
22-
let(:expected_text) { "5eead5x" }
22+
let(:expected_text) { "94d9235" }
2323

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

3232
context "when .source_version file exists" do
3333
let(:sha) { "94d92356828a56db25fccff9d50f41c525eead5y" }
34-
let(:expected_text) { "5eead5y" }
34+
let(:expected_text) { "94d9235" }
3535

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

0 commit comments

Comments
 (0)