Conflict Resolution in Merge Request reverses merge direction
### Summary
When a merge request (from feature branch to destination branch) has a merge conflict, two options are presented: "Resolve Conflict" and "Merge Locally". "Merge Locally" explains how to merge from the feature branch into the destination branch correctly. The "Resolve Conflicts" button, however, explains that it will merge from the destination branch into the feature branch, which is the opposite of what is requested.
### Steps to reproduce
Create two branches, and make conflicting changes on each. Do a merge request from branch 1 to branch 2. When attempting to merge there will be a warning, "There are merge conflicts". In order to resolve this, click on "Resolve Conflicts", and you will see on the following page that it wants to merge from branch 2 to branch 1.
### Example Project
### What is the current *bug* behavior?
Merges in the wrong direction
### What is the expected *correct* behavior?
Merges in the correct direction
### Relevant logs and/or screenshots
See screenshots
Image1 is from the Merge Request

Image 2 is from the "Reolve Conflicts"

### Output of checks
#### Results of GitLab environment info
<details>
<summary>Expand for output related to GitLab environment info</summary>
<pre>
System information
System: Debian 8.8
Proxy: no
Current User: git
Using RVM: no
Ruby Version: 2.3.3p222
Gem Version: 2.6.6
Bundler Version:1.13.7
Rake Version: 10.5.0
Redis Version: 3.2.5
Git Version: 2.13.0
Sidekiq Version:5.0.0
Go Version: unknown
GitLab information
Version: 9.3.5-ee
Revision: 44d109d
Directory: /opt/gitlab/embedded/service/gitlab-rails
DB Adapter: postgresql
DB Version: 9.6.3
URL: https://gitlab.check24tech.de
HTTP Clone URL: https://gitlab.check24tech.de/some-group/some-project.git
SSH Clone URL: git@gitlab.check24tech.de:some-group/some-project.git
Elasticsearch: no
Geo: no
Using LDAP: yes
Using Omniauth: no
GitLab Shell
Version: 5.1.1
Repository storage paths:
- default: /var/opt/gitlab/git-data/repositories
Hooks: /opt/gitlab/embedded/service/gitlab-shell/hooks
Git: /opt/gitlab/embedded/bin/git
</pre>
</details>
#### Results of GitLab application Check
<details>
<summary>Expand for output related to the GitLab application check</summary>
<pre>
WARNING: The GitLab Enterprise Edition license will expire on 2017-08-03.
Checking GitLab Shell ...
GitLab Shell version >= 5.1.1 ? ... OK (5.1.1)
Repo base directory exists?
default... yes
Repo storage directories are symlinks?
default... no
Repo paths owned by git:root, or git:git?
default... yes
Repo paths access is drwxrws---?
default... yes
hooks directories in repos are links: ...
3/1 ... wrong or missing hooks
Try fixing it:
sudo -u git -H /opt/gitlab/embedded/service/gitlab-shell/bin/create-hooks /var/opt/gitlab/git-data/repositories
Check the hooks_path in config/gitlab.yml
Check your gitlab-shell installation
For more information see:
doc/install/installation.md in section "GitLab Shell"
Please fix the error above and rerun the checks.
7/3 ... wrong or missing hooks
Try fixing it:
sudo -u git -H /opt/gitlab/embedded/service/gitlab-shell/bin/create-hooks /var/opt/gitlab/git-data/repositories
Check the hooks_path in config/gitlab.yml
Check your gitlab-shell installation
For more information see:
doc/install/installation.md in section "GitLab Shell"
Please fix the error above and rerun the checks.
7/4 ... wrong or missing hooks
Try fixing it:
sudo -u git -H /opt/gitlab/embedded/service/gitlab-shell/bin/create-hooks /var/opt/gitlab/git-data/repositories
Check the hooks_path in config/gitlab.yml
Check your gitlab-shell installation
For more information see:
doc/install/installation.md in section "GitLab Shell"
Please fix the error above and rerun the checks.
7/5 ... wrong or missing hooks
Try fixing it:
sudo -u git -H /opt/gitlab/embedded/service/gitlab-shell/bin/create-hooks /var/opt/gitlab/git-data/repositories
Check the hooks_path in config/gitlab.yml
Check your gitlab-shell installation
For more information see:
doc/install/installation.md in section "GitLab Shell"
Please fix the error above and rerun the checks.
7/6 ... wrong or missing hooks
Try fixing it:
sudo -u git -H /opt/gitlab/embedded/service/gitlab-shell/bin/create-hooks /var/opt/gitlab/git-data/repositories
Check the hooks_path in config/gitlab.yml
Check your gitlab-shell installation
For more information see:
doc/install/installation.md in section "GitLab Shell"
Please fix the error above and rerun the checks.
7/7 ... wrong or missing hooks
Try fixing it:
sudo -u git -H /opt/gitlab/embedded/service/gitlab-shell/bin/create-hooks /var/opt/gitlab/git-data/repositories
Check the hooks_path in config/gitlab.yml
Check your gitlab-shell installation
For more information see:
doc/install/installation.md in section "GitLab Shell"
Please fix the error above and rerun the checks.
7/8 ... wrong or missing hooks
Try fixing it:
sudo -u git -H /opt/gitlab/embedded/service/gitlab-shell/bin/create-hooks /var/opt/gitlab/git-data/repositories
Check the hooks_path in config/gitlab.yml
Check your gitlab-shell installation
For more information see:
doc/install/installation.md in section "GitLab Shell"
Please fix the error above and rerun the checks.
9/9 ... wrong or missing hooks
Try fixing it:
sudo -u git -H /opt/gitlab/embedded/service/gitlab-shell/bin/create-hooks /var/opt/gitlab/git-data/repositories
Check the hooks_path in config/gitlab.yml
Check your gitlab-shell installation
For more information see:
doc/install/installation.md in section "GitLab Shell"
Please fix the error above and rerun the checks.
10/10 ... wrong or missing hooks
Try fixing it:
sudo -u git -H /opt/gitlab/embedded/service/gitlab-shell/bin/create-hooks /var/opt/gitlab/git-data/repositories
Check the hooks_path in config/gitlab.yml
Check your gitlab-shell installation
For more information see:
doc/install/installation.md in section "GitLab Shell"
Please fix the error above and rerun the checks.
13/12 ... wrong or missing hooks
Try fixing it:
sudo -u git -H /opt/gitlab/embedded/service/gitlab-shell/bin/create-hooks /var/opt/gitlab/git-data/repositories
Check the hooks_path in config/gitlab.yml
Check your gitlab-shell installation
For more information see:
doc/install/installation.md in section "GitLab Shell"
Please fix the error above and rerun the checks.
2/13 ... repository is empty
14/14 ... wrong or missing hooks
Try fixing it:
sudo -u git -H /opt/gitlab/embedded/service/gitlab-shell/bin/create-hooks /var/opt/gitlab/git-data/repositories
Check the hooks_path in config/gitlab.yml
Check your gitlab-shell installation
For more information see:
doc/install/installation.md in section "GitLab Shell"
Please fix the error above and rerun the checks.
15/15 ... wrong or missing hooks
Try fixing it:
sudo -u git -H /opt/gitlab/embedded/service/gitlab-shell/bin/create-hooks /var/opt/gitlab/git-data/repositories
Check the hooks_path in config/gitlab.yml
Check your gitlab-shell installation
For more information see:
doc/install/installation.md in section "GitLab Shell"
Please fix the error above and rerun the checks.
14/16 ... wrong or missing hooks
Try fixing it:
sudo -u git -H /opt/gitlab/embedded/service/gitlab-shell/bin/create-hooks /var/opt/gitlab/git-data/repositories
Check the hooks_path in config/gitlab.yml
Check your gitlab-shell installation
For more information see:
doc/install/installation.md in section "GitLab Shell"
Please fix the error above and rerun the checks.
17/17 ... wrong or missing hooks
Try fixing it:
sudo -u git -H /opt/gitlab/embedded/service/gitlab-shell/bin/create-hooks /var/opt/gitlab/git-data/repositories
Check the hooks_path in config/gitlab.yml
Check your gitlab-shell installation
For more information see:
doc/install/installation.md in section "GitLab Shell"
Please fix the error above and rerun the checks.
7/18 ... wrong or missing hooks
Try fixing it:
sudo -u git -H /opt/gitlab/embedded/service/gitlab-shell/bin/create-hooks /var/opt/gitlab/git-data/repositories
Check the hooks_path in config/gitlab.yml
Check your gitlab-shell installation
For more information see:
doc/install/installation.md in section "GitLab Shell"
Please fix the error above and rerun the checks.
14/20 ... wrong or missing hooks
Try fixing it:
sudo -u git -H /opt/gitlab/embedded/service/gitlab-shell/bin/create-hooks /var/opt/gitlab/git-data/repositories
Check the hooks_path in config/gitlab.yml
Check your gitlab-shell installation
For more information see:
doc/install/installation.md in section "GitLab Shell"
Please fix the error above and rerun the checks.
19/25 ... repository is empty
9/26 ... ok
19/43 ... ok
7/45 ... ok
2/46 ... ok
24/47 ... ok
24/48 ... ok
27/49 ... ok
10/50 ... ok
24/51 ... ok
25/53 ... ok
22/54 ... repository is empty
24/55 ... ok
23/56 ... ok
19/68 ... ok
14/78 ... ok
14/80 ... ok
14/82 ... ok
14/86 ... ok
25/87 ... ok
37/95 ... ok
24/98 ... ok
24/110 ... ok
5/116 ... ok
19/119 ... ok
19/124 ... ok
19/125 ... ok
7/126 ... ok
19/127 ... ok
19/128 ... ok
Running /opt/gitlab/embedded/service/gitlab-shell/bin/check
Check GitLab API access: OK
Access to /var/opt/gitlab/.ssh/authorized_keys: OK
Send ping to redis server: OK
gitlab-shell self-check successful
Checking GitLab Shell ... Finished
Checking Sidekiq ...
Running? ... yes
Number of Sidekiq processes ... 1
Checking Sidekiq ... Finished
Checking Reply by email ...
Reply by email is disabled in config/gitlab.yml
Checking Reply by email ... Finished
Checking LDAP ...
Server: ldapmain
LDAP authentication... Success
LDAP users with access to your GitLab server (only showing the first 100 results)
.... USERS REMOVED FROM OUTPUT ....
Checking LDAP ... Finished
Checking GitLab ...
Git configured correctly? ... yes
Database config exists? ... yes
All migrations up? ... yes
Database contains orphaned GroupMembers? ... no
GitLab config exists? ... yes
GitLab config up to date? ... yes
Log directory writable? ... yes
Tmp directory writable? ... yes
Uploads directory exists? ... yes
Uploads directory has correct permissions? ... yes
Uploads directory tmp has correct permissions? ... yes
Init script exists? ... skipped (omnibus-gitlab has no init script)
Init script up-to-date? ... skipped (omnibus-gitlab has no init script)
Projects have namespace: ...
3/1 ... yes
7/3 ... yes
7/4 ... yes
7/5 ... yes
7/6 ... yes
7/7 ... yes
7/8 ... yes
9/9 ... yes
10/10 ... yes
13/12 ... yes
2/13 ... yes
14/14 ... yes
15/15 ... yes
14/16 ... yes
17/17 ... yes
7/18 ... yes
14/20 ... yes
19/25 ... yes
9/26 ... yes
19/43 ... yes
7/45 ... yes
2/46 ... yes
24/47 ... yes
24/48 ... yes
27/49 ... yes
10/50 ... yes
24/51 ... yes
25/53 ... yes
22/54 ... yes
24/55 ... yes
23/56 ... yes
19/68 ... yes
14/78 ... yes
14/80 ... yes
14/82 ... yes
14/86 ... yes
25/87 ... yes
37/95 ... yes
24/98 ... yes
24/110 ... yes
5/116 ... yes
19/119 ... yes
19/124 ... yes
19/125 ... yes
7/126 ... yes
19/127 ... yes
19/128 ... yes
Redis version >= 2.8.0? ... yes
Ruby version >= 2.3.3 ? ... yes (2.3.3)
Git version >= 2.7.3 ? ... yes (2.13.0)
Active users: ... 30
Elasticsearch version 5.1 - 5.3? ... skipped (elasticsearch is disabled)
Checking GitLab ... Finished
</pre>
</details>
### Possible fixes