[damned-lies] Force git checkout



commit 0c5dcebb98ef3183732b5052977f5566497d42a5
Author: Claude Paroz <claude 2xlibre net>
Date:   Tue Feb 12 16:33:42 2013 +0100

    Force git checkout
    
    It happens that some branch produces uncommitted files which would
    be overwritten by another branch. Adding '-f' forces those files to
    be overwritten without errors.

 stats/models.py |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/stats/models.py b/stats/models.py
index 3bf4521..e37a03a 100644
--- a/stats/models.py
+++ b/stats/models.py
@@ -584,7 +584,8 @@ class Branch(models.Model):
                     })
             elif vcs_type == "git":
                 # tester "cd \"%(localdir)s\" && git checkout %(branch)s && git clean -dfq && git pull origin/%(branch)s"
-                commandList.append("cd \"%(localdir)s\" && git checkout %(branch)s && git fetch && git reset --hard origin/%(branch)s && git clean -dfq" % {
+                commandList.append("cd \"%(localdir)s\" && git checkout -f %(branch)s && "
+                                   "git fetch && git reset --hard origin/%(branch)s && git clean -dfq" % {
                     "localdir" : modulepath,
                     "branch" : self.name,
                     })


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]