about summary refs log tree commit diff
path: root/tools/magrathea/mg.scm
diff options
context:
space:
mode:
Diffstat (limited to 'tools/magrathea/mg.scm')
-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 38447e930324..990fb87f90ba 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