Fix some newer GCC compiler 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 44 45 46 47 48 49
diff --git a/tests-clar/checkout/index.c b/tests-clar/checkout/index.c
index a185aec..c9352d8 100644
--- a/tests-clar/checkout/index.c
+++ b/tests-clar/checkout/index.c
@@ -245,7 +245,7 @@ void test_checkout_index__options_dir_modes(void)
(void)p_umask(um = p_umask(022));
cl_git_pass(p_stat("./testrepo/a", &st));
- cl_assert_equal_i_fmt(st.st_mode, GIT_FILEMODE_TREE | 0701 & ~um, "%07o");
+ cl_assert_equal_i_fmt(st.st_mode, (GIT_FILEMODE_TREE | 0701) & ~um, "%07o");
/* File-mode test, since we're on the 'dir' branch */
cl_git_pass(p_stat("./testrepo/a/b.txt", &st));
diff --git a/tests-clar/diff/rename.c b/tests-clar/diff/rename.c
index ac3814d..b5a9935 100644
--- a/tests-clar/diff/rename.c
+++ b/tests-clar/diff/rename.c
@@ -1100,7 +1100,6 @@ void test_diff_rename__can_rename_from_rewrite(void)
{
git_index *index;
git_tree *tree;
- git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT;
git_diff_list *diff;
git_diff_options diffopts = GIT_DIFF_OPTIONS_INIT;
git_diff_find_options findopts = GIT_DIFF_FIND_OPTIONS_INIT;
@@ -1110,8 +1109,6 @@ void test_diff_rename__can_rename_from_rewrite(void)
const char *targets[] = { "songof7cities.txt", "this-is-a-rename.txt" };
struct rename_expected expect = { 2, status, sources, targets };
- opts.checkout_strategy = GIT_CHECKOUT_FORCE;
-
cl_git_pass(git_repository_index(&index, g_repo));
cl_git_pass(p_rename("renames/songof7cities.txt", "renames/this-is-a-rename.txt"));
diff --git a/tests-clar/odb/backend/nonrefreshing.c b/tests-clar/odb/backend/nonrefreshing.c
index abb824d..9abca2b 100644
--- a/tests-clar/odb/backend/nonrefreshing.c
+++ b/tests-clar/odb/backend/nonrefreshing.c
@@ -132,8 +132,8 @@ static int build_fake_backend(
static void setup_repository_and_backend(git_error_code error_code)
{
- git_odb *odb;
- git_odb_backend *backend;
+ git_odb *odb = NULL;
+ git_odb_backend *backend = NULL;
_repo = cl_git_sandbox_init("testrepo.git");