summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorValera Sizov <vsv2711@gmail.com>2011-10-08 15:15:24 -0700
committerValera Sizov <vsv2711@gmail.com>2011-10-08 15:33:36 -0700
commit01d9f998447cb0e4d88836b71520b70926e6b3e8 (patch)
treed45df8dd98dff17b18e0d158101ef85bc8e2f6b2
parent971a6a5cb7e4e55d7bbb46404d8a80308f40b6b2 (diff)
downloadgitlab-ce-01d9f998447cb0e4d88836b71520b70926e6b3e8.tar.gz
transition to gem git
-rw-r--r--Gemfile3
-rw-r--r--Gemfile.lock6
-rw-r--r--lib/gitosis.rb11
3 files changed, 7 insertions, 13 deletions
diff --git a/Gemfile b/Gemfile
index 466ab327519..bf64a37a3f9 100644
--- a/Gemfile
+++ b/Gemfile
@@ -14,12 +14,11 @@ gem 'six'
gem 'therubyracer'
gem 'faker'
gem 'seed-fu', :branch => 'rails-3-1', :git => 'git://github.com/mbleigh/seed-fu.git'
-gem "lockfile"
gem "inifile"
-gem "net-ssh"
gem "albino", :git => "git://github.com/randx/albino.git"
gem "kaminari"
gem "thin"
+gem "git"
group :assets do
gem 'sass-rails', " ~> 3.1.0"
diff --git a/Gemfile.lock b/Gemfile.lock
index e15f7123d62..dd97bd671d6 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -97,6 +97,7 @@ GEM
faker (0.9.5)
i18n (~> 0.4)
ffi (1.0.9)
+ git (1.2.5)
grit (2.4.1)
diff-lcs (~> 1.1)
mime-types (~> 1.15)
@@ -121,14 +122,12 @@ GEM
libv8 (3.3.10.2)
linecache19 (0.5.12)
ruby_core_source (>= 0.1.4)
- lockfile (1.4.3)
mail (2.3.0)
i18n (>= 0.4.0)
mime-types (~> 1.16)
treetop (~> 1.4.8)
mime-types (1.16)
multi_json (1.0.3)
- net-ssh (2.2.1)
nokogiri (1.5.0)
orm_adapter (0.0.5)
polyglot (0.3.2)
@@ -247,14 +246,13 @@ DEPENDENCIES
database_cleaner
devise (= 1.4.7)
faker
+ git
grit
haml-rails
inifile
jquery-rails
kaminari
launchy
- lockfile
- net-ssh
rails (= 3.1.0)
rails-footnotes (>= 3.7.5.rc4)
rspec-rails
diff --git a/lib/gitosis.rb b/lib/gitosis.rb
index d19fb23966d..d0997825f41 100644
--- a/lib/gitosis.rb
+++ b/lib/gitosis.rb
@@ -1,6 +1,4 @@
-require 'lockfile'
require 'inifile'
-require 'net/ssh'
class Gitosis
@@ -11,14 +9,13 @@ class Gitosis
Dir.mkdir @local_dir
# clone repo
- `git clone #{GITOSIS['admin_uri']} #{@local_dir}/gitosis`
+ @repo = Git.clone(GITOSIS['admin_uri'], "#{@local_dir}/gitosis")
end
def push
- # add, commit, push, and remove local tmp dir
- `cd #{File.join(@local_dir,'gitosis')} ; git add keydir/* gitosis.conf`
- `cd #{File.join(@local_dir,'gitosis')} ; git commit -a -m 'updated by Gitlab Gitosis'`
- `cd #{File.join(@local_dir,'gitosis')} ; git push`
+ @repo.add('.')
+ @repo.commit_all "Gitlab"
+ @repo.push
# remove local copy
`rm -Rf #{@local_dir}`