"fatal: Not a git repository" loading bug
Opened this issue · 0 comments
JasonBarnabe commented
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