summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2020-10-04 17:40:38 +0100
committerGitHub <noreply@github.com>2020-10-04 17:40:38 +0100
commit30ba98a11a629a6a4bbe2784a6f1db2698c307ab (patch)
treece96faefdf9555e4bcaf2eb98e4dc32ea47b01b3
parent8087498dc519f40ac099d31d9f29eb1544f62329 (diff)
parentb254a5856589e06d5ef66bfb7c7b2127249f440e (diff)
downloadlibgit2-30ba98a11a629a6a4bbe2784a6f1db2698c307ab.tar.gz
Merge pull request #5636 from libgit2/pks-release-build-warnings
Fix release build warnings
-rw-r--r--src/patch_parse.c2
-rw-r--r--src/refs.c2
-rw-r--r--src/sysdir.c5
3 files changed, 6 insertions, 3 deletions
diff --git a/src/patch_parse.c b/src/patch_parse.c
index 918575306..f65b1087d 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 ed900577d..51635a9e4 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 bcef97c03..6dc78c8fd 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;
}