Commit 29149848d4be32a1a54d8a663f43f869cecbabc7
1 parent
eefe826f
Exists in
master
and in
4 other branches
fix gitosis log error
Showing
1 changed file
with
9 additions
and
7 deletions
Show diff stats
lib/gitosis.rb
| ... | ... | @@ -11,19 +11,21 @@ class Gitosis |
| 11 | 11 | |
| 12 | 12 | Dir.mkdir @local_dir |
| 13 | 13 | |
| 14 | - @repo = Git.clone(GITOSIS['admin_uri'], "#{@local_dir}/gitosis") | |
| 14 | + `git clone #{GITOSIS['admin_uri']} #{@local_dir}/gitosis` | |
| 15 | 15 | end |
| 16 | 16 | |
| 17 | 17 | def push |
| 18 | - @repo.add('.') | |
| 19 | - @repo.commit_all "Gitlab" | |
| 20 | - @repo.push | |
| 18 | + Dir.chdir(File.join(@local_dir, "gitosis")) | |
| 19 | + `git add -A` | |
| 20 | + `git commit -am "Gitlab"` | |
| 21 | + `git push` | |
| 22 | + Dir.chdir(Rails.root) | |
| 21 | 23 | |
| 22 | - #FileUtils.rm_rf(@local_dir) | |
| 24 | + FileUtils.rm_rf(@local_dir) | |
| 23 | 25 | end |
| 24 | 26 | |
| 25 | 27 | def configure |
| 26 | - status = Timeout::timeout(5) do | |
| 28 | + status = Timeout::timeout(20) do | |
| 27 | 29 | File.open(File.join(Dir.tmpdir,"gitlabhq-gitosis.lock"), "w+") do |f| |
| 28 | 30 | f.flock(File::LOCK_EX) |
| 29 | 31 | |
| ... | ... | @@ -39,7 +41,7 @@ class Gitosis |
| 39 | 41 | end |
| 40 | 42 | |
| 41 | 43 | def destroy_project(project) |
| 42 | - #FileUtils.rm_rf(project.path_to_repo) | |
| 44 | + FileUtils.rm_rf(project.path_to_repo) | |
| 43 | 45 | |
| 44 | 46 | conf = IniFile.new(File.join(@local_dir,'gitosis','gitosis.conf')) |
| 45 | 47 | ... | ... |