Ver código fonte

app.py: do force checkout always

Shiv Tyagi 1 ano atrás
pai
commit
3d9c13b1a7
1 arquivos alterados com 2 adições e 2 exclusões
  1. 2 2
      app.py

+ 2 - 2
app.py

@@ -137,11 +137,11 @@ def do_checkout(remote, commit_reference, s_dir, force_fetch=False, temp_branch_
 
     app.logger.info("Checking out to %s (%s/%s)" % (git_hash_target, remote, commit_reference))
 
-    result = run_git(['git', 'checkout', git_hash_target], cwd=s_dir)
+    result = run_git(['git', 'checkout', '-f', git_hash_target], cwd=s_dir)
     if result.returncode != 0:
         # commit with the given hash isn't fetched? fetch and try again
         fetch_remote(remote)
-        result = run_git(['git', 'checkout', git_hash_target], cwd=s_dir)
+        result = run_git(['git', 'checkout', '-f', git_hash_target], cwd=s_dir)
         if result.returncode != 0:
             raise Exception("Could not checkout to the requested commit")