Deleting tag fails when branch and tag exists with the same name
While testing !1006 (merged), I have a test that attempts to delete the tag v1.1.0
, but this fails because https://gitlab.com/gitlab-org/gitlab-test has both refs/heads/v1.1.0
and refs/tags/v1.1.0
:
time="2018-12-18T11:21:15-08:00" level=info msg="I, [2018-12-18T11:21:15.603634 #38932] INFO -- : Pushing deleted branches from /Users/stanhu/gitlab/gitaly/internal/testhelper/testdata/data/TestSuccessfulUpdateRemoteMirrorRequestWithWildcards066627066 to remote remote_mirror_2: [\"v1.1.0\"]" supervisor.args="[bundle exec bin/ruby-cd /Users/stanhu/gitlab/gitaly/_build/src/gitlab.com/gitlab-org/gitaly/internal/service/remote /Users/stanhu/gitlab/gitaly/_build/src/gitlab.com/gitlab-org/gitaly/ruby/bin/gitaly-ruby 38900 /var/folders/jf/z0tr5kvs589dk92xkzkk49wc0000gn/T/gitaly-ruby944237139/socket.1]" supervisor.name=gitaly-ruby.1
--- FAIL: TestSuccessfulUpdateRemoteMirrorRequestWithWildcards (1.17s)
test_hook.go:39: time="2018-12-18T11:21:15-08:00" level=error msg="finished streaming call with code Unknown" error="rpc error: code = Unknown desc = Gitlab::Git::CommandError: warning: refname '1942eed5cc108b19c7405106e81fa96125d0be22' is ambiguous.\nGit normally never creates a ref that ends with 40 hex characters\nbecause it will be ignored when you just specify 40-hex. These refs\nmay be created by mistake. For example,\n\n git checkout -b $br $(git rev-parse ...)\n\nwhere \"$br\" is somehow empty and a 40-hex ref is created. Please\nexamine these refs and maybe delete them. Turn this message off by\nrunning \"git config advice.objectNameWarning false\"\nTo /Users/stanhu/gitlab/gitaly/internal/testhelper/testdata/data/TestSuccessfulUpdateRemoteMirrorRequestWithWildcards080387857\n * [new branch] 11-0-stable -> 11-0-stable\n * [new branch] 11-1-stable -> 11-1-stable\nwarning: refname '1942eed5cc108b19c7405106e81fa96125d0be22' is ambiguous.\nGit normally never creates a ref that ends with 40 hex characters\nbecause it will be ignored when you just specify 40-hex. These refs\nmay be created by mistake. For example,\n\n git checkout -b $br $(git rev-parse ...)\n\nwhere \"$br\" is somehow empty and a 40-hex ref is created. Please\nexamine these refs and maybe delete them. Turn this message off by\nrunning \"git config advice.objectNameWarning false\"\nTo /Users/stanhu/gitlab/gitaly/internal/testhelper/testdata/data/TestSuccessfulUpdateRemoteMirrorRequestWithWildcards080387857\n + f4e6814...33fde33 v1.0.0 -> v1.0.0 (forced update)\n * [new tag] new-tag -> new-tag\nerror: dst refspec v1.1.0 matches more than one.\nerror: failed to push some refs to '/Users/stanhu/gitlab/gitaly/internal/testhelper/testdata/data/TestSuccessfulUpdateRemoteMirrorRequestWithWildcards080387857'\n" grpc.code=Unknown grpc.method=UpdateRemoteMirror grpc.service=gitaly.RemoteService grpc.start_time="2018-12-18T11:21:15-08:00" grpc.time_ms=425.41 span.kind=server system=grpc test=TestSuccessfulUpdateRemoteMirrorRequestWithWildcards
require.go:794:
Error Trace: update_remote_mirror_test.go:138
Error: Received unexpected error:
rpc error: code = Unknown desc = Gitlab::Git::CommandError: warning: refname '1942eed5cc108b19c7405106e81fa96125d0be22' is ambiguous.
Git normally never creates a ref that ends with 40 hex characters
because it will be ignored when you just specify 40-hex. These refs
may be created by mistake. For example,
git checkout -b $br $(git rev-parse ...)
This is similar to #1329 (closed).
Edited by Stan Hu