Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"fatal: Not a git repository" loading bug #128

Open
JasonBarnabe opened this issue Mar 9, 2017 · 0 comments
Open

"fatal: Not a git repository" loading bug #128

JasonBarnabe opened this issue Mar 9, 2017 · 0 comments

Comments

@JasonBarnabe
Copy link

git '--git-dir=/var/www/apps/squash_new/tmp/repos/9e3c81a890dc2672a028f90882720f25a92a7423.git' cat-file '-t' '1bb6d3d3e401638d133ebb79798729dfb3092bf8'  2>&1:fatal: Not a git repository: '/var/www/apps/squash_new/tmp/repos/9e3c81a890dc2672a028f90882720f25a92a7423.git'

The git-dir option is supposed to point to the .git directory.

diff --git a/app/models/project.rb b/app/models/project.rb
index 625f852..adf06f0 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -196,7 +196,7 @@ class Project < ActiveRecord::Base
     repo_mutex.synchronize do
       @repo ||= begin
         exists = File.exist?(repo_path) || clone_repo
-        exists ? Git.bare(repo_path) : nil
+        exists ? Git.bare("#{repo_path}/.git") : nil
       end
     end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant