Skip to content

Commit

Permalink
WS
Browse files Browse the repository at this point in the history
  • Loading branch information
quirkey committed Feb 1, 2012
1 parent 687327d commit 72fb9e3
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions USAGE.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,19 @@
assert blob.written?
end

#
#
# getting the contents of a blob with commit and path
#

commit = repo.lookup(commit_oid)
commit.tree.each do |entry|
if (entry.name == path)
if (entry.name == path)
&& (entry.type == 'blob')
return entry.gobect.data
end
end

#
#
# getting commit data from oid
#

Expand All @@ -52,7 +52,7 @@
puts commit.message


#
#
# listing a single level tree
#

Expand All @@ -62,7 +62,7 @@
end


#
#
# git ls-tree -rt
#

Expand All @@ -79,7 +79,7 @@ def ls_tree(tree_oid)
commit = repo.lookup(commit_oid)
ls_tree(tree_oid)

#
#
# updating a file and committing
#

Expand Down Expand Up @@ -157,8 +157,3 @@ def ls_tree(tree_oid)
return commit.oid
end
end





0 comments on commit 72fb9e3

Please sign in to comment.