summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/git/base.rb6
-rw-r--r--lib/git/branch.rb4
-rw-r--r--lib/git/lib.rb5
3 files changed, 15 insertions, 0 deletions
diff --git a/lib/git/base.rb b/lib/git/base.rb
index 6372beb..4c5cdf5 100644
--- a/lib/git/base.rb
+++ b/lib/git/base.rb
@@ -6,6 +6,8 @@ module Git
@repository = nil
@index = nil
+ @lib = nil
+
# opens a bare Git Repository - no working directory options
def self.bare(git_dir)
self.new :repository => git_dir
@@ -376,6 +378,10 @@ module Git
commit_tree(tree, opts)
end
+ def update_ref(branch, commit)
+ branch(branch).update_ref(commit)
+ end
+
def ls_files
self.lib.ls_files
end
diff --git a/lib/git/branch.rb b/lib/git/branch.rb
index f9106ab..c2ce810 100644
--- a/lib/git/branch.rb
+++ b/lib/git/branch.rb
@@ -75,6 +75,10 @@ module Git
end
end
+ def update_ref(commit)
+ @base.lib.update_ref(@full, commit)
+ end
+
def to_a
[@full]
end
diff --git a/lib/git/lib.rb b/lib/git/lib.rb
index 690043d..7742702 100644
--- a/lib/git/lib.rb
+++ b/lib/git/lib.rb
@@ -376,6 +376,11 @@ module Git
command('commit-tree', arr_opts)
end
+ def update_ref(branch, commit)
+ command('update-ref', [branch.to_s, commit.to_s])
+ end
+
+
# creates an archive file
#
# options