summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-10-29 13:25:06 +0000
committerDouwe Maan <douwe@gitlab.com>2015-10-29 13:25:06 +0000
commitf24324adbea1f7df20e77647b1df7085cba51a95 (patch)
tree36e3887cef2a8eee6ce4b00fa871e0b66883d740
parentead3ffd7a516911458d84311c4f1b4153f1071b5 (diff)
parentf56c7d9f8e66c69de6e984e497dd529874b8d638 (diff)
downloadgitlab-ce-f24324adbea1f7df20e77647b1df7085cba51a95.tar.gz
Merge branch 'fix-issue-3138' into 'master'
Force update refs/merge-requests/X/head upon a push to the source branch of a merge request If a user rebases and does a force push, GitLab would not update the `refs/merge-requests/X/head` link. Using the -f flag forces this to happen. Closes #3138 See merge request !1683
-rw-r--r--CHANGELOG1
-rw-r--r--app/models/repository.rb2
2 files changed, 2 insertions, 1 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 0d89fca9fc1..fa13343ea2b 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,7 @@
Please view this file on the master branch, on stable branches it's out of date.
v 8.2.0 (unreleased)
+ - Force update refs/merge-requests/X/head upon a push to the source branch of a merge request (Stan Hu)
- Improved performance of replacing references in comments
- Show last project commit to default branch on project home page
- Highlight comment based on anchor in URL
diff --git a/app/models/repository.rb b/app/models/repository.rb
index a3ba5f4c18a..c9b36bd8170 100644
--- a/app/models/repository.rb
+++ b/app/models/repository.rb
@@ -528,7 +528,7 @@ class Repository
end
def fetch_ref(source_path, source_ref, target_ref)
- args = %W(git fetch #{source_path} #{source_ref}:#{target_ref})
+ args = %W(git fetch -f #{source_path} #{source_ref}:#{target_ref})
Gitlab::Popen.popen(args, path_to_repo)
end