Commit cc2e849a authored by Valery Sizov's avatar Valery Sizov

Use a fixed git abbrev parameter when we fetch a git revision

parent 04496085
---
title: Use a fixed git abbrev parameter when we fetch a git revision
merge_request: 26707
author:
type: fixed
...@@ -24,7 +24,7 @@ module Gitlab ...@@ -24,7 +24,7 @@ module Gitlab
if File.exist?(root.join("REVISION")) if File.exist?(root.join("REVISION"))
File.read(root.join("REVISION")).strip.freeze File.read(root.join("REVISION")).strip.freeze
else else
result = Gitlab::Popen.popen_with_detail(%W[#{config.git.bin_path} log --pretty=format:%h -n 1]) result = Gitlab::Popen.popen_with_detail(%W[#{config.git.bin_path} log --pretty=format:%h --abbrev=11 -n 1])
if result.status.success? if result.status.success?
result.stdout.chomp.freeze result.stdout.chomp.freeze
......
...@@ -10,7 +10,7 @@ describe Gitlab do ...@@ -10,7 +10,7 @@ describe Gitlab do
end end
describe '.revision' do describe '.revision' do
let(:cmd) { %W[#{described_class.config.git.bin_path} log --pretty=format:%h -n 1] } let(:cmd) { %W[#{described_class.config.git.bin_path} log --pretty=format:%h --abbrev=11 -n 1] }
around do |example| around do |example|
described_class.instance_variable_set(:@_revision, nil) described_class.instance_variable_set(:@_revision, nil)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment