chiark
/
gitweb
/
~mdw
/
stgit
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fc804a4
)
Create a new utility function in git.py for setting the HEAD link
author
Chuck Lever
<cel@netapp.com>
Thu, 6 Oct 2005 10:12:44 +0000
(11:12 +0100)
committer
Catalin Marinas
<catalin.marinas@gmail.com>
Thu, 6 Oct 2005 10:12:44 +0000
(11:12 +0100)
Add a new method in git.py for switching the HEAD link to point to a
different ref.
Signed-off-by: Chuck Lever <cel@netapp.com>
stgit/git.py
patch
|
blob
|
blame
|
history
diff --git
a/stgit/git.py
b/stgit/git.py
index 5dcb90db33249a80adb4d532a48f57510bb1aac5..a118140a01efb0efc7f39281169664d85f75116f 100644
(file)
--- a/
stgit/git.py
+++ b/
stgit/git.py
@@
-233,6
+233,12
@@
def get_head_file():
"""
return os.path.basename(_output_one_line('git-symbolic-ref HEAD'))
+def set_head_file(ref):
+ """Resets HEAD to point to a new ref
+ """
+ if __run('git-symbolic-ref HEAD', [ref]) != 0:
+ raise GitException, 'Could not set head to "%s"' % ref
+
def __set_head(val):
"""Sets the HEAD value
"""