X-Git-Url: https://git.distorted.org.uk/~mdw/stgit/blobdiff_plain/05c9e6653351bb3c2c2ae822ace38f190288d70d..2b4b9c29d1bc5d98eafdfdc82b99b57ebd4298d0:/stgit/git.py diff --git a/stgit/git.py b/stgit/git.py index a7b1c3f..016bc3a 100644 --- a/stgit/git.py +++ b/stgit/git.py @@ -274,7 +274,7 @@ def rev_parse(git_id): raise GitException, 'Unknown revision: %s' % git_id def branch_exists(branch): - """Existance check for the named branch + """Existence check for the named branch """ for line in _output_lines(['git-rev-parse', '--symbolic', '--all']): if line.strip() == branch: @@ -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 """