summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZeger-Jan van de Weg <mail@zjvandeweg.nl>2015-11-02 19:02:08 +0100
committerZeger-Jan van de Weg <mail@zjvandeweg.nl>2016-02-05 08:39:44 +0100
commitbe3399868cbcfdce85daa6fdf53a079bc163056a (patch)
treee3ba77b1664ce5b59f82239010c30cfcd4be8d9d
parent42e0e35784de81d2a0f7bff05870ddc5c531d0bb (diff)
downloadgitlab-ce-be3399868cbcfdce85daa6fdf53a079bc163056a.tar.gz
Minor refactoring on Gitlab::Git
-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