From b99a02b040dd0dfbbace447bab95737d89fae575 Mon Sep 17 00:00:00 2001 From: Chuck Lever Date: Thu, 6 Oct 2005 11:12:44 +0100 Subject: [PATCH] Create a new utility function in git.py for setting the HEAD link Add a new method in git.py for switching the HEAD link to point to a different ref. Signed-off-by: Chuck Lever --- stgit/git.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/stgit/git.py b/stgit/git.py index 5dcb90d..a118140 100644 --- 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 """ -- 2.11.0