diff --git a/lib/gitlab/git.rb b/lib/gitlab/git.rb index f065cc5e9e9962c70407370403881452dab5c795..a33daeb119f72ab0c2d0927bbd37f017ac3a27eb 100644 --- a/lib/gitlab/git.rb +++ b/lib/gitlab/git.rb @@ -1,8 +1,9 @@ module Gitlab module Git - BLANK_SHA = '0' * 40 - TAG_REF_PREFIX = "refs/tags/" - BRANCH_REF_PREFIX = "refs/heads/" + # '0' * 40 -- this was easyer to freeze + BLANK_SHA = "0000000000000000000000000000000000000000".freeze + TAG_REF_PREFIX = "refs/tags/".freeze + BRANCH_REF_PREFIX = "refs/heads/".freeze class << self def ref_name(ref) diff --git a/spec/lib/gitlab/git_spec.rb b/spec/lib/gitlab/git_spec.rb new file mode 100644 index 0000000000000000000000000000000000000000..3b4052fa5492156c691eb3cb5d83fc7fa347932d --- /dev/null +++ b/spec/lib/gitlab/git_spec.rb @@ -0,0 +1,9 @@ +require 'spec_helper' + +describe Gitlab::Git do + describe "BLANK_SHA" do + it "is a string of 40 zero's" do + expect(Gitlab::Git::BLANK_SHA).to eq('0' * 40) + end + end +end