Commit 0c383ccfcef763662fc988abfb12b18dcb9cbaab

Thomas de Grivel 2023-02-28T17:24:30

git reset --hard

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
diff --git a/lib/rbpkg/repo.rb b/lib/rbpkg/repo.rb
index 7e6473e..a4c1831 100644
--- a/lib/rbpkg/repo.rb
+++ b/lib/rbpkg/repo.rb
@@ -34,7 +34,11 @@ class Rbpkg::Repo
   def checkout(branch)
     verbose(3, "repo(#{name.inspect}).checkout")
     sh_branch=sh_quote(branch)
-    cmd! "cd #{sh_quote(src_dir!)} && git fetch #{sh_quote(remote)} #{sh_branch} && git checkout #{sh_branch} -- && git submodule update"
+    cmd! "cd #{sh_quote(src_dir!)} && git fetch #{sh_quote(remote)} #{sh_branch}"
+    cmd! "cd #{sh_quote(src_dir!)} && git reset --hard"
+    cmd! "cd #{sh_quote(src_dir!)} && git checkout #{sh_branch} --"
+    cmd! "cd #{sh_quote(src_dir!)} && git reset --hard"
+    cmd! "cd #{sh_quote(src_dir!)} && git submodule update"
   end
 
   def ci(ref, commit)