summaryrefslogtreecommitdiff
path: root/lib/tasks
diff options
context:
space:
mode:
authorAlejandro Rodríguez <alejorro70@gmail.com>2017-07-20 17:30:29 -0400
committerAlejandro Rodríguez <alejorro70@gmail.com>2017-07-20 17:30:29 -0400
commitc9c0606297883a3a47a5e5e9433e495dc89938c7 (patch)
tree3e8432cd8954a4300740cfbe5e22a14b9ca8ca19 /lib/tasks
parent729ac897fd98b7cadee6af3f764a2efc4ecde43e (diff)
downloadgitlab-ce-c9c0606297883a3a47a5e5e9433e495dc89938c7.tar.gz
Fixes an issue where, when using branch versions, the component wouldn't be updated after the first branch checkout. We also save one step, since checking out the FETCH_HEAD with `-f` already does what `reset --hard` did.
Diffstat (limited to 'lib/tasks')
-rw-r--r--lib/tasks/gitlab/task_helpers.rb9
1 files changed, 2 insertions, 7 deletions
diff --git a/lib/tasks/gitlab/task_helpers.rb b/lib/tasks/gitlab/task_helpers.rb
index 964aa0fe1bc..28b2d86eed2 100644
--- a/lib/tasks/gitlab/task_helpers.rb
+++ b/lib/tasks/gitlab/task_helpers.rb
@@ -153,7 +153,6 @@ module Gitlab
clone_repo(repo, target_dir) unless Dir.exist?(target_dir)
checkout_version(version, target_dir)
- reset_to_version(version, target_dir)
end
def clone_repo(repo, target_dir)
@@ -161,12 +160,8 @@ module Gitlab
end
def checkout_version(version, target_dir)
- run_command!(%W[#{Gitlab.config.git.bin_path} -C #{target_dir} fetch --quiet])
- run_command!(%W[#{Gitlab.config.git.bin_path} -C #{target_dir} checkout --quiet #{version}])
- end
-
- def reset_to_version(version, target_dir)
- run_command!(%W[#{Gitlab.config.git.bin_path} -C #{target_dir} reset --hard #{version}])
+ run_command!(%W[#{Gitlab.config.git.bin_path} -C #{target_dir} fetch --quiet origin #{version}])
+ run_command!(%W[#{Gitlab.config.git.bin_path} -C #{target_dir} checkout -f --quiet FETCH_HEAD --])
end
end
end