cweiske / phorkie

Self-hosted pastebin software written in PHP. Pastes are editable, forkable, may have multiple files and are stored in git repositories.
https://cweiske.de/phorkie.htm
GNU Affero General Public License v3.0
216 stars 23 forks source link

creating pastes broken #23

Closed cweiske closed 7 years ago

cweiske commented 7 years ago

seems to be a new git version.

what I know so far:

  1. git repo gets created
  2. adding file fails:

Some errors in executing git command Output: Error: fatal: This operation must be run in a work tree

maybe something to do with using --separate-git-dir

git 2.8

$ git init --separate-git-dir git work
Initialisierte leeres Git-Repository in /home/cweiske/tmp/igttest/git/
$ cd git
$ git st
.. works
$ touch ../work/foo
$ git add foo
.. works

git 2.11.0

$ git init --separate-git-dir git work
Initialisierte leeres Git-Repository in /home/cweiske/tmp/igttest/git/
$ cd git
$ git st
fatal: This operation must be run in a work tree
$ touch ../work/foo
$ git add foo
fatal: This operation must be run in a work tree
cweiske commented 7 years ago
diff --git a/src/phorkie/Repository.php b/src/phorkie/Repository.php
index 013f017..eae2fb4 100644
--- a/src/phorkie/Repository.php
+++ b/src/phorkie/Repository.php
@@ -143,7 +143,7 @@ class Repository

     public function getVc()
     {
-        return new \VersionControl_Git($this->gitDir);
+        return new \VersionControl_Git($this->workDir);
     }

     /**