<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -71,29 +71,28 @@ class GitStore
     @packs   = {}
     @objects = {}
 
-    init_handler
-
-    load_packs(&quot;#{git_path}/objects/pack&quot;)
-    load
-  end
-
-  def init_handler
     @handler = {
       'yml' =&gt; YAMLHandler.new
     }
+    
     @handler.default = DefaultHandler.new
+
+    load_packs(&quot;#{git_path}/objects/pack&quot;)
+    
+    load
   end
 
-  # The path to the current head file.
+  # Returns the path to the current head file.
   def head_path
     &quot;#{git_path}/refs/heads/#{branch}&quot;
   end
 
-  # The path to the object file for given id.
+  # Returns the path to the object file for given id.
   def object_path(id)
     &quot;#{git_path}/objects/#{ id[0...2] }/#{ id[2..39] }&quot;
   end
 
+  # Returns the path to the git data directory.
   def git_path
     if bare
       &quot;#{path}&quot;
@@ -109,6 +108,7 @@ class GitStore
     File.read(head_path).strip if File.exists?(head_path)
   end
 
+  # Return a handler for a given path.
   def handler_for(path)
     handler[ path.split('.').last ]
   end
@@ -128,20 +128,24 @@ class GitStore
     root.each(&amp;block)
   end
 
+  # Returns all paths found in this store.
   def paths
     root.paths
   end
 
+  # Returns all values found in this store.
   def values
     root.values
   end
 
+  # Remove given path from store.
   def delete(path)
     root.delete(path)
   end
 
-  def tree(name)
-    root.tree(name)
+  # Find or create a tree object with given path.
+  def tree(path)
+    root.tree(path)
   end
 
   # Returns the store as a hash tree.
@@ -239,9 +243,9 @@ class GitStore
     File.unlink(&quot;#{head_path}.lock&quot;) rescue nil
   end
 
-  # Write the commit object to disk and set the head of the current branch.
+  # Write a commit object to disk and set the head of the current branch.
   #
-  # Returns the id of the commit object
+  # Returns the commit object
   def commit(message = '', author = User.from_config, committer = author)
     root.write
 
@@ -260,6 +264,7 @@ class GitStore
     @head = commit
   end
 
+  # Returns a list of commits starting from head commit.
   def commits(limit = 10, start = head)
     entries = []
     current = start
@@ -272,6 +277,9 @@ class GitStore
     entries
   end
 
+  # Get an object by its id.
+  #
+  # Returns a tree, blob, commit or tag object.
   def get(id)
     return nil if id.nil?
 
@@ -284,6 +292,9 @@ class GitStore
     objects[id] = klass.new(self, id, content)
   end
 
+  # Save a git object to the store.
+  #
+  # Returns the object id.
   def put(object)
     type = CLASS_TYPE[object.class] or raise NotImplementedError, &quot;class not supported: #{object.class}&quot;
 
@@ -299,6 +310,7 @@ class GitStore
     Digest::SHA1.hexdigest(str)[0, 40]
   end
 
+  # Calculate the id for a given type and raw data string.
   def id_for(type, content)
     sha &quot;#{type} #{content.length}\0#{content}&quot;
   end
@@ -343,6 +355,8 @@ class GitStore
     id
   end
 
+  protected
+
   if 'String'[0].respond_to?(:ord)
     def legacy_loose_object?(buf)
       buf[0] == ?x &amp;&amp; (((buf[0].ord &lt;&lt; 8) + buf[1].ord) % 31 == 0)</diff>
      <filename>lib/git_store.rb</filename>
    </modified>
    <modified>
      <diff>@@ -46,7 +46,7 @@ class GitStore
       @table.map { |k, v| &quot;#{ v.mode } #{ k }\0#{ [v.write].pack(&quot;H*&quot;) }&quot; }.join
     end
 
-    # Write this tree back to the git repository.
+    # Write this treetree back to the git repository.
     #
     # Returns the object id of the tree.
     def write</diff>
      <filename>lib/git_store/tree.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>876b2a8dae1ffdf75467c869a2c861a52003452c</id>
    </parent>
  </parents>
  <author>
    <name>Matthias Georgi</name>
    <email>matti.georgi@gmail.com</email>
  </author>
  <url>http://github.com/manveru/git_store/commit/89f8995567f16cf343ef8156e1ad2c54b666a2e4</url>
  <id>89f8995567f16cf343ef8156e1ad2c54b666a2e4</id>
  <committed-date>2009-11-02T17:14:18-08:00</committed-date>
  <authored-date>2009-06-15T02:46:03-07:00</authored-date>
  <message>improved some comments.</message>
  <tree>81336cdfd2a3da9967f215f7525e23c5a9551762</tree>
  <committer>
    <name>Michael Fellinger</name>
    <email>m.fellinger@gmail.com</email>
  </committer>
</commit>
