(commit_id, repo)
| 193 | |
| 194 | |
| 195 | def _do_set_head(commit_id, repo): |
| 196 | try: |
| 197 | commit = repo.revparse_single(commit_id) |
| 198 | except KeyError: |
| 199 | raise ValueError('Invalid head {0}'.format(commit_id)) |
| 200 | |
| 201 | curr_b = repo.current_branch |
| 202 | curr_b.head = commit.id |
| 203 | pprint.ok( |
| 204 | 'Head of current branch {0} is now {1}'.format(curr_b, pprint.commit_str(commit))) |
| 205 | return True |