소스 검색

app.py: do force checkout always

Shiv Tyagi 1 년 전
부모
커밋
3d9c13b1a7
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  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")