Commit 5c0c8fdd by Etienne Samson

repository: assert that we're passed a valid head pointer

parent 814e7acb
...@@ -2123,6 +2123,8 @@ int git_repository_head(git_reference **head_out, git_repository *repo) ...@@ -2123,6 +2123,8 @@ int git_repository_head(git_reference **head_out, git_repository *repo)
git_reference *head; git_reference *head;
int error; int error;
assert(head_out);
if ((error = git_reference_lookup(&head, repo, GIT_HEAD_FILE)) < 0) if ((error = git_reference_lookup(&head, repo, GIT_HEAD_FILE)) < 0)
return error; return error;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment