Merge pull request #5636 from libgit2/pks-release-build-warnings Fix release build warnings
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
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;
}