lib/gitolite/gitolite_admin.rb
#Writes all changed aspects out to the file system
#will also stage all changes
Writes all changed aspects out to the file system
will also stage all changes
Writes all changed aspects out to the file system will also stage all changes
def save
      Dir.chdir(@gl_admin.working_dir) do
        if @config
          new_conf = @config.to_file(@confdir)
          @gl_admin.add(new_conf)
        end
        if @ssh_keys
          files = list_keys(@keydir).map{|f| File.basename f}
          keys = @ssh_keys.values.map{|f| f.map {|t| t.filename}}.flatten
          to_remove = (files - keys).map { |f| File.join(@keydir, f)}
          @gl_admin.remove(to_remove)
          @ssh_keys.each_value do |key|
            next if key.respond_to?(:dirty?) && !key.dirty?
            key.each do |k|
              @gl_admin.add(k.to_file(@keydir))
            end
          end
        end
      end
    end
def save Dir . chdir ( @gl_admin . working_dir ) do if @config new_conf = @config . to_file ( @confdir ) @gl_admin . add ( new_conf ) end if @ssh_keys files = list_keys ( @keydir ) . map { | f | File . basename f } keys = @ssh_keys . values . map { | f | f . map { | t | t . filename } } . flatten to_remove = ( files - keys ) . map { | f | File . join ( @keydir , f ) } @gl_admin . remove ( to_remove ) @ssh_keys . each_value do | key | next if key . respond_to? ( :dirty? ) && ! key . dirty? key . each do | k | @gl_admin . add ( k . to_file ( @keydir ) ) end end end end end
Writes all changed aspects out to the file system
will also stage all changes
Writes all changed aspects out to the file system will also stage all changes
#Process config file (if loaded, i.e. may be modified) #Process ssh keys (if loaded, i.e. may be modified) #Write only keys from sets that has been modified