if not branch_exists(new_head):
raise GitException, 'Branch "%s" does not exist' % name
if not branch_exists(new_head):
raise GitException, 'Branch "%s" does not exist' % name
if tree_id != get_head():
refresh_index()
if __run('git-read-tree -u -m', [get_head(), tree_id]) != 0:
if tree_id != get_head():
refresh_index()
if __run('git-read-tree -u -m', [get_head(), tree_id]) != 0: