Commit 9c9c1485 authored by Sean McGivern's avatar Sean McGivern

Fix squashing when a ref is named HEAD

This would print an ambiguous refs warning, so silence that with
--quiet. HEAD in this context will refer to the 'current commit', not
the ref with that name.
parent 89463fc7
......@@ -50,8 +50,12 @@ module MergeRequests
'commit squashed changes'
)
# May print a warning for ambiguous refs, but we can ignore that with
# `--quiet` and just take the SHA, if present. HEAD here always refers to
# the current HEAD commit, even if there is another ref called HEAD.
#
squash_sha = run_git_command(
%w(rev-parse HEAD),
%w(rev-parse --quiet --verify HEAD),
tree_path,
git_env,
'get SHA of squashed commit'
......
---
title: Fix squashing MRs when the repository contains a ref named HEAD
merge_request:
author:
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