Merge pull request #2597 from ethomson/fixup Trivial fixups
diff --git a/src/repository.c b/src/repository.c
index 51d39eb..f032c89 100644
--- a/src/repository.c
+++ b/src/repository.c
@@ -1567,8 +1567,10 @@ int git_repository_head_unborn(git_repository *repo)
error = git_repository_head(&ref, repo);
git_reference_free(ref);
- if (error == GIT_EUNBORNBRANCH)
+ if (error == GIT_EUNBORNBRANCH) {
+ giterr_clear();
return 1;
+ }
if (error < 0)
return -1;
diff --git a/tests/stash/save.c b/tests/stash/save.c
index 7873d20..a5bdd0c 100644
--- a/tests/stash/save.c
+++ b/tests/stash/save.c
@@ -370,8 +370,8 @@ void test_stash_save__including_untracked_without_any_untracked_file_creates_an_
void test_stash_save__ignored_directory(void)
{
- cl_git_pass(mkdir("stash/ignored_directory", 0777));
- cl_git_pass(mkdir("stash/ignored_directory/sub", 0777));
+ cl_git_pass(p_mkdir("stash/ignored_directory", 0777));
+ cl_git_pass(p_mkdir("stash/ignored_directory/sub", 0777));
cl_git_mkfile("stash/ignored_directory/sub/some_file", "stuff");
assert_status(repo, "ignored_directory/sub/some_file", GIT_STATUS_WT_NEW);