chiark / gitweb /
Allow tag objects to be passed on the command line
[stgit] / stgit / git.py
index 582e803628fb6d10ee058b4c8562f582d735e9ef..016bc3a6ddeaceff9066ba04e075a856874d863f 100644 (file)
@@ -308,7 +308,7 @@ def switch_branch(name):
     if not branch_exists(new_head):
         raise GitException, 'Branch "%s" does not exist' % name
 
-    tree_id = rev_parse(new_head + '^0')
+    tree_id = rev_parse(new_head + '^{commit}')
     if tree_id != get_head():
         refresh_index()
         if __run('git-read-tree -u -m', [get_head(), tree_id]) != 0: