summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/gitlab/git.rb7
-rw-r--r--spec/lib/gitlab/git_spec.rb9
2 files changed, 13 insertions, 3 deletions
diff --git a/lib/gitlab/git.rb b/lib/gitlab/git.rb
index f065cc5e9e9..a33daeb119f 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 00000000000..3b4052fa549
--- /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