about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--tools/magrathea/mg.scm7
1 files changed, 4 insertions, 3 deletions
diff --git a/tools/magrathea/mg.scm b/tools/magrathea/mg.scm
index 38447e9303..990fb87f90 100644
--- a/tools/magrathea/mg.scm
+++ b/tools/magrathea/mg.scm
@@ -168,9 +168,10 @@ USAGE
   (or mg--repository-root
       (begin
         (set! mg--repository-root
-              (string-chomp
-               (call-with-input-pipe "git rev-parse --show-toplevel"
-                                     (lambda (p) (read-string #f p)))))
+              (or (get-environment-variable "MG_ROOT")
+                  (string-chomp
+                   (call-with-input-pipe "git rev-parse --show-toplevel"
+                                         (lambda (p) (read-string #f p))))))
         mg--repository-root)))
 
 ;; determine the current path relative to the root of the repository