Commit 30ba98a11a629a6a4bbe2784a6f1db2698c307ab

Edward Thomson 2020-10-04T17:40:38

Merge pull request #5636 from libgit2/pks-release-build-warnings Fix release build warnings

diff --git a/src/patch_parse.c b/src/patch_parse.c
index 9185753..f65b108 100644
--- a/src/patch_parse.c
+++ b/src/patch_parse.c
@@ -198,7 +198,7 @@ static int parse_header_git_index(
 		return -1;
 
 	if (git_parse_peek(&c, &ctx->parse_ctx, 0) == 0 && c == ' ') {
-		uint16_t mode;
+		uint16_t mode = 0;
 
 		git_parse_advance_chars(&ctx->parse_ctx, 1);
 
diff --git a/src/refs.c b/src/refs.c
index ed90057..51635a9 100644
--- a/src/refs.c
+++ b/src/refs.c
@@ -606,7 +606,7 @@ int git_reference_rename(
 	const char *log_message)
 {
 	refs_update_head_payload payload;
-	git_signature *signature;
+	git_signature *signature = NULL;
 	git_repository *repo;
 	int error;
 
diff --git a/src/sysdir.c b/src/sysdir.c
index bcef97c..6dc78c8 100644
--- a/src/sysdir.c
+++ b/src/sysdir.c
@@ -298,8 +298,11 @@ static int git_sysdir_find_in_dirlist(
 	}
 
 done:
+	if (name)
+		git_error_set(GIT_ERROR_OS, "the %s file '%s' doesn't exist", label, name);
+	else
+		git_error_set(GIT_ERROR_OS, "the %s directory doesn't exist", label);
 	git_buf_dispose(path);
-	git_error_set(GIT_ERROR_OS, "the %s file '%s' doesn't exist", label, name);
 	return GIT_ENOTFOUND;
 }