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

This commit is contained in:
Valery Sizov 2019-03-28 13:05:03 +02:00
parent 04496085c1
commit cc2e849afd
3 changed files with 7 additions and 2 deletions

View file

@ -0,0 +1,5 @@
---
title: Use a fixed git abbrev parameter when we fetch a git revision
merge_request: 26707
author:
type: fixed

View file

@ -24,7 +24,7 @@ module Gitlab
if File.exist?(root.join("REVISION"))
File.read(root.join("REVISION")).strip.freeze
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?
result.stdout.chomp.freeze

View file

@ -10,7 +10,7 @@ describe Gitlab do
end
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|
described_class.instance_variable_set(:@_revision, nil)