class RJGit::LocalRefWriter

Implementation of RefWriter for local files. This class is able to generate and write the $GIT_DIR/info/refs. For use in Repo::update_server_info.

Attributes

path[RW]

Public Class Methods

new(refs, path) click to toggle source
Calls superclass method
# File lib/repo.rb, line 15
def initialize(refs, path)
  super(refs)
  @path = path
end

Public Instance Methods

writeFile(file, content) click to toggle source
# File lib/repo.rb, line 20
def writeFile(file, content)
    file = File.join(@path, file)
  begin
    f = File.open(file, "w")
    f.write String.from_java_bytes(content)
    f.close
  rescue
    raise IOException.new # JGit API requires RefWriter.writeFile to throw IOException
  end
end