X-Git-Url: https://git.distorted.org.uk/~mdw/stgit/blobdiff_plain/388f63b6f44cae4d4b9a92b299c1ae45cc6de70d..2b4b9c29d1bc5d98eafdfdc82b99b57ebd4298d0:/stgit/git.py diff --git a/stgit/git.py b/stgit/git.py index 61436bb..016bc3a 100644 --- a/stgit/git.py +++ b/stgit/git.py @@ -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: @@ -599,7 +599,7 @@ def switch(tree_id): __set_head(tree_id) -def reset(files = None, tree_id = None): +def reset(files = None, tree_id = 'HEAD'): """Revert the tree changes relative to the given tree_id. It removes any local changes """