lib/gitolite/gitolite_admin.rb in jbox-gitolite-1.1.9 vs lib/gitolite/gitolite_admin.rb in jbox-gitolite-1.1.10
- old
+ new
@@ -5,10 +5,11 @@
attr_accessor :gl_admin
CONF = "gitolite.conf"
CONFDIR = "conf"
KEYDIR = "keydir"
+ DEBUG = false
#Gitolite gem's default git commit message
DEFAULT_COMMIT_MSG = "Committed by the gitolite gem"
# Intialize with the path to
@@ -18,10 +19,11 @@
@gl_admin = Grit::Repo.new(path)
@conf = options[:conf] || CONF
@confdir = options[:confdir] || CONFDIR
@keydir = options[:keydir] || KEYDIR
+ Grit.debug = options[:debug] || DEBUG
end
# This method will bootstrap a gitolite-admin repo
# at the given path. A typical gitolite-admin
# repo will have the following tree:
@@ -90,11 +92,11 @@
@gl_admin.git.native(:add, {:chdir => @gl_admin.working_dir}, new_key)
end
end
end
- @gl_admin.commit_index(commit_message)
+ @gl_admin.git.native(:commit, {:chdir => @gl_admin.working_dir}, '-a', '-m', commit_message)
end
# This method will destroy all local tracked changes, resetting the local gitolite
# git repo to HEAD and reloading the entire repository
# Note that this will also delete all untracked files
@@ -124,16 +126,14 @@
self.apply
end
# Updates the repo with changes from remote master
def update(options = {})
- options = {:reset => true, :rebase => false }.merge(options)
+ options = {:reset => true, :rebase => false}.merge(options)
reset! if options[:reset]
- Dir.chdir(@gl_admin.working_dir) do
- @gl_admin.git.pull({:rebase => options[:rebase]}, "origin", "master")
- end
+ @gl_admin.git.native(:pull, {:chdir => @gl_admin.working_dir, :rebase => options[:rebase]}, "origin", "master")
reload!
end
def add_key(key)