summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRobert Speicher <robert@gitlab.com>2017-07-21 13:51:50 +0000
committerRobert Speicher <robert@gitlab.com>2017-07-21 13:51:50 +0000
commit87499a8f9c8221e5600a4dad928e2ce118f18157 (patch)
tree7292b5171228c2fbf59a9eba4b7fe3452602a6e3 /lib
parent83481414341b7ebb82b5a3d948b39e95fdca5289 (diff)
parentc9c0606297883a3a47a5e5e9433e495dc89938c7 (diff)
downloadgitlab-ce-87499a8f9c8221e5600a4dad928e2ce118f18157.tar.gz
Merge branch '34788-testenv-doesn-t-update-the-component-correctly-when-a-branch-is-specified' into 'master'
Improve version handling on component install tasks Closes #34788 See merge request !13006
Diffstat (limited to 'lib')
-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