]> gitweb.factorcode.org Git - factor.git/commitdiff
Delete the .git/index in case it's corrupted. Do a "git reset --hard HEAD" before...
authorDoug Coleman <doug.coleman@gmail.com>
Sun, 13 Jun 2010 23:23:41 +0000 (18:23 -0500)
committerDoug Coleman <doug.coleman@gmail.com>
Mon, 14 Jun 2010 00:34:17 +0000 (19:34 -0500)
extra/mason/common/common.factor
extra/mason/updates/updates.factor

index db68a558e094e68031866cb76e5a4532fd445e66..5e37a683cf07949ea157d063a8494f2b0155657b 100644 (file)
@@ -57,6 +57,7 @@ M: unix really-delete-tree delete-tree ;
             [ day>> , ]
             [ hour>> , ]
             [ minute>> , ]
+            [ drop nano-count , ]
         } cleave
     ] { } make [ pad-00 ] map "-" join ;
 
index 60a155eae7b3238fa99ff366a668b8a2d3fc1e06..57a8c748d20c439207681c34d1620633bed806c2 100644 (file)
@@ -1,9 +1,17 @@
 ! Copyright (C) 2008, 2010 Eduardo Cavazos, Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: kernel io.launcher bootstrap.image.download
-mason.common mason.platform ;
+USING: bootstrap.image.download combinators.short-circuit
+io.directories io.launcher kernel mason.common mason.platform ;
 IN: mason.updates
 
+: git-reset-cmd ( -- cmd )
+    {
+        "git"
+        "reset"
+        "--hard"
+        "HEAD"
+    } ;
+
 : git-pull-cmd ( -- cmd )
     {
         "git"
@@ -14,6 +22,8 @@ IN: mason.updates
     } ;
 
 : updates-available? ( -- ? )
+    ".git/index" delete-file
+    git-reset-cmd short-running-process
     git-id
     git-pull-cmd short-running-process
     git-id
@@ -23,6 +33,4 @@ IN: mason.updates
     boot-image-name maybe-download-image ;
 
 : new-code-available? ( -- ? )
-    updates-available?
-    new-image-available?
-    or ;
\ No newline at end of file
+    { [ updates-available? ] [ new-image-available? ] } 0|| ;