From d077adf2bc521caa2319cdddcfef74abb99699de Mon Sep 17 00:00:00 2001 From: Christian Couder Date: Wed, 1 Apr 2020 15:03:36 +0200 Subject: [PATCH] Disable advice.objectNameWarning when rebasing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It looks like some of our tests are sometimes triggering this advice and then failing because they didn't expect it. For example this is a test error we get: --- FAIL: TestFailedUserRebaseConfirmableDueToGitError (0.17s) rebase_test.go:390: Error Trace: rebase_test.go:390 Error: "Auto-merging README.md CONFLICT (content): Merge conflict in README.md From ssh://gitaly/internal * branch master -> FETCH_HEAD 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 switch -c $br $(git rev-parse ...) where "$br" is somehow empty and a 40-hex ref is created. Please examine these refs and maybe delete them. Turn this message off by running "git config advice.objectNameWarning false" error: could not apply eb8f5fb... Make whitespace changes versão 5.5 Resolve all conflicts manually, mark them as resolved with "git add/rm ", then run "git rebase --continue". You can instead skip this commit: run "git rebase --skip". To abort and get back to the state before "git rebase", run "git rebase --abort". Could not apply eb8f5fb... Make whitespace changes versão 5.5 " does not contain "error: Failed to merge in the changes." --- .../unreleased/cc-disable-advice-object-name-warning.yml | 5 +++++ ruby/lib/gitlab/git/repository.rb | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 changelogs/unreleased/cc-disable-advice-object-name-warning.yml diff --git a/changelogs/unreleased/cc-disable-advice-object-name-warning.yml b/changelogs/unreleased/cc-disable-advice-object-name-warning.yml new file mode 100644 index 0000000000..97c650c87e --- /dev/null +++ b/changelogs/unreleased/cc-disable-advice-object-name-warning.yml @@ -0,0 +1,5 @@ +--- +title: Disable advice.objectNameWarning when rebasing +merge_request: 2001 +author: +type: fixed diff --git a/ruby/lib/gitlab/git/repository.rb b/ruby/lib/gitlab/git/repository.rb index dcc75e7b19..54c3af749c 100644 --- a/ruby/lib/gitlab/git/repository.rb +++ b/ruby/lib/gitlab/git/repository.rb @@ -371,7 +371,7 @@ module Gitlab with_worktree(worktree, branch, sparse_checkout_files: diff_files, env: env) do run_git!( - %W[pull --rebase #{remote_repo_path} #{remote_branch}], + %W[-c advice.objectNameWarning=false pull --rebase #{remote_repo_path} #{remote_branch}], chdir: worktree.path, env: env, include_stderr: true ) -- GitLab