]> BookStack Code Mirror - system-cli/blobdiff - scripts/Commands/InitCommand.php
Got restore command to a working state
[system-cli] / scripts / Commands / InitCommand.php
index 720dcd1190f296323546a40e2078b077009ecf7d..26ab54c9e54abbfa4634fe94bc0a274252fe5596 100644 (file)
@@ -105,10 +105,11 @@ class InitCommand extends Command
      */
     protected function cloneBookStackViaGit(string $installDir): void
     {
-        $errors = (new ProgramRunner('git', '/usr/bin/git'))
+        $git = (new ProgramRunner('git', '/usr/bin/git'))
             ->withTimeout(240)
-            ->withIdleTimeout(15)
-            ->runCapturingStdErr([
+            ->withIdleTimeout(15);
+
+        $errors = $git->runCapturingStdErr([
                 'clone', '-q',
                 '--branch', 'release',
                 '--single-branch',
@@ -119,6 +120,12 @@ class InitCommand extends Command
         if ($errors) {
             throw new CommandError("Failed git clone with errors:\n" . $errors);
         }
+
+        // Disable file permission tracking for git repo
+        $git->runCapturingStdErr([
+            '-C', $installDir,
+            'config', 'core.fileMode', 'false'
+        ]);
     }
 
     /**