MCPcopy
hub / github.com/gitless-vcs/gitless / _do_set_head

Function _do_set_head

gitless/cli/gl_branch.py:195–205  ·  view source on GitHub ↗
(commit_id, repo)

Source from the content-addressed store, hash-verified

193
194
195def _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

Callers 1

mainFunction · 0.85

Calls 1

revparse_singleMethod · 0.80

Tested by

no test coverage detected