Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-docs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAchilleas Pipinellis <axilleas@axilleas.me>2017-09-06 21:38:38 +0300
committerAchilleas Pipinellis <axilleas@axilleas.me>2017-09-06 21:38:38 +0300
commit4e6d57f7f9eabc483b2f79d4d1bab5be8974020d (patch)
tree0f45ba34857dfca4f973df67451c57cf27a433e1 /Rakefile
parent3bd7a07309a502b69e7b98ad04c3e7c37362120f (diff)
Force reset FETCH_HEAD when fetching branch
Diffstat (limited to 'Rakefile')
-rw-r--r--Rakefile7
1 files changed, 4 insertions, 3 deletions
diff --git a/Rakefile b/Rakefile
index 7b9fd9ab..f3a7eadd 100644
--- a/Rakefile
+++ b/Rakefile
@@ -75,9 +75,10 @@ task :pull_repos do
# Enter the temporary directory and return after block is completed.
FileUtils.cd(temp_dir) do
# Update repository from master. Fetch and reset to avoid
- # merge conflicts
- `git fetch origin #{branch}`
- `git reset --hard #{branch}`
+ # merge conflicts.
+ # Why: https://gitlab.com/gitlab-com/gitlab-docs/merge_requests/119
+ # How: https://stackoverflow.com/a/9589927/974710
+ `git fetch origin #{branch} && git reset --hard FETCH_HEAD && git clean -df`
end
else
puts "This shouldn't happen"