git.samba.org
/
jelmer
/
dulwich-libgit2.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
84f6b2a
)
Really simple API for updating refs
author
John Carr
<john.carr@unrouted.co.uk>
Thu, 18 Dec 2008 10:25:50 +0000
(10:25 +0000)
committer
John Carr
<john.carr@unrouted.co.uk>
Thu, 18 Dec 2008 10:25:50 +0000
(10:25 +0000)
dulwich/repo.py
patch
|
blob
|
history
diff --git
a/dulwich/repo.py
b/dulwich/repo.py
index 1842e298e19ed1d2924774359255421b45b2612d..3002403170a2112b8d358722e7fb62db1fa7dbd3 100644
(file)
--- a/
dulwich/repo.py
+++ b/
dulwich/repo.py
@@
-90,6
+90,16
@@
class Repo(object):
if os.path.exists(file):
return self._get_ref(file)
+ def set_ref(self, name, vale):
+ file = os.path.join(self.basedir(), name)
+ open(file, 'w').write(value)
+
+ def remove_ref(self, name):
+ file = os.path.join(self.basedir(), name)
+ if os.path.exists(file):
+ os.remove(file)
+ return
+
def get_tags(self):
ret = {}
for root, dirs, files in os.walk(os.path.join(self.basedir(), 'refs', 'tags')):