Repository: easybuilders/easybuild-framework

Issue:
failing GitHub tests in CI with recent git version
There's two tests failing in CI in the `develop` branch currently (these are skipped for PRs because they require a GitHub token).

These tests still work fine locally for me though, so the failures are probably related to a more recent `git` version?

Example: https://github.com/easybuilders/easybuild-framework/runs/3997592444?check_suite_focus=true

```
ERROR: test_github_new_pr_from_branch (test.framework.options.CommandLineOptionsTest)
Test --new-pr-from-branch.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/runner/16737b45482bb04e594de245f4d4c6966a3b72e7/lib/python2.7/site-packages/test/framework/options.py", line 4093, in test_github_new_pr_from_branch
    txt, _ = self._run_mock_eb(args, do_build=True, raise_error=True, testing=False)
  File "/tmp/runner/16737b45482bb04e594de245f4d4c6966a3b72e7/lib/python2.7/site-packages/test/framework/options.py", line 3989, in _run_mock_eb
    self.eb_main(args, **kwargs)
  File "/tmp/runner/16737b45482bb04e594de245f4d4c6966a3b72e7/lib/python2.7/site-packages/test/framework/utilities.py", line 336, in eb_main
    raise myerr
GitCommandError: Cmd('git') failed due to: exit code(128)
  cmdline: git pull github_easybuilders_MqDkh develop
  stderr: 'From https://github.com/easybuilders/easybuild-easyconfigs
 * branch                  develop    -> FETCH_HEAD
 * [new branch]            develop    -> github_easybuilders_MqDkh/develop
hint: You have divergent branches and need to specify how to reconcile them.
hint: You can do so by running one of the following commands sometime before
hint: your next pull:
hint: 
hint:   git config pull.rebase false  # merge (the default strategy)
hint:   git config pull.rebase true   # rebase
hint:   git config pull.ff only       # fast-forward only
hint: 
hint: You can replace "git config" with "git config --global" to set a default
hint: preference for all repositories. You can also pass --rebase, --no-rebase,
hint: or --ff-only on the command line to override the configured default per
hint: invocation.
fatal: Need to specify how to reconcile divergent branches.'

======================================================================
ERROR: test_github_sync_branch_with_develop (test.framework.options.CommandLineOptionsTest)
Test use of --sync-branch-with-develop (dry run only).
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/runner/16737b45482bb04e594de245f4d4c6966a3b72e7/lib/python2.7/site-packages/test/framework/options.py", line 4399, in test_github_sync_branch_with_develop
    stdout, stderr = self._run_mock_eb(args, do_build=True, raise_error=True, testing=False)
  File "/tmp/runner/16737b45482bb04e594de245f4d4c6966a3b72e7/lib/python2.7/site-packages/test/framework/options.py", line 3989, in _run_mock_eb
    self.eb_main(args, **kwargs)
  File "/tmp/runner/16737b45482bb04e594de245f4d4c6966a3b72e7/lib/python2.7/site-packages/test/framework/utilities.py", line 336, in eb_main
    raise myerr
GitCommandError: Cmd('git') failed due to: exit code(128)
  cmdline: git pull github_easybuilders_XvNCt develop
  stderr: 'From https://github.com/easybuilders/easybuild-easyconfigs
 * branch                  develop    -> FETCH_HEAD
 * [new branch]            develop    -> github_easybuilders_XvNCt/develop
hint: You have divergent branches and need to specify how to reconcile them.
hint: You can do so by running one of the following commands sometime before
hint: your next pull:
hint: 
hint:   git config pull.rebase false  # merge (the default strategy)
hint:   git config pull.rebase true   # rebase
hint:   git config pull.ff only       # fast-forward only
hint: 
hint: You can replace "git config" with "git config --global" to set a default
hint: preference for all repositories. You can also pass --rebase, --no-rebase,
hint: or --ff-only on the command line to override the configured default per
hint: invocation.
fatal: Need to specify how to reconcile divergent branches.'
```


Discussion:
@migueldiascosta This is going to be a problem for the upcoming release...

Do you have time to take a closer look at this in the coming days?
@boegel seems to be due to this https://github.com/git/git/commit/031e2f7ae195069d00d21cde906fce5b0318dbdd ? The versions match...

isn't it just a matter of setting the reconciliation strategy?

Resolving patch:
diff --git a/easybuild/tools/github.py b/easybuild/tools/github.py
--- a/easybuild/tools/github.py
+++ b/easybuild/tools/github.py
@@ -2409,7 +2409,7 @@ def sync_with_develop(git_repo, branch_name, github_account, github_repo):
     remote = create_remote(git_repo, github_account, github_repo, https=True)
 
     # fetch latest version of develop branch
-    pull_out = git_repo.git.pull(remote.name, GITHUB_DEVELOP_BRANCH)
+    pull_out = git_repo.git.pull(remote.name, GITHUB_DEVELOP_BRANCH, no_rebase=True)
     _log.debug("Output of 'git pull %s %s': %s", remote.name, GITHUB_DEVELOP_BRANCH, pull_out)
 
     # fetch to make sure we can check out the 'develop' branch


Test patch: