Skip to content

Commit ca14942

Browse files
committed
tests: declare functions statically where appropriate
1 parent 3f024b6 commit ca14942

File tree

34 files changed

+442
-60
lines changed

34 files changed

+442
-60
lines changed

tests/checkout/tree.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ void test_checkout_tree__can_disable_pattern_match(void)
509509
cl_assert(git_fs_path_isfile("testrepo/branch_file.txt"));
510510
}
511511

512-
void assert_conflict(
512+
static void assert_conflict(
513513
const char *entry_path,
514514
const char *new_content,
515515
const char *parent_sha,
@@ -1034,7 +1034,8 @@ void test_checkout_tree__filemode_preserved_in_index(void)
10341034
git_index_free(index);
10351035
}
10361036

1037-
mode_t read_filemode(const char *path)
1037+
#ifndef GIT_WIN32
1038+
static mode_t read_filemode(const char *path)
10381039
{
10391040
git_str fullpath = GIT_STR_INIT;
10401041
struct stat st;
@@ -1050,6 +1051,7 @@ mode_t read_filemode(const char *path)
10501051

10511052
return result;
10521053
}
1054+
#endif
10531055

10541056
void test_checkout_tree__filemode_preserved_in_workdir(void)
10551057
{
@@ -1267,7 +1269,7 @@ void test_checkout_tree__case_changing_rename(void)
12671269
git_commit_free(master_commit);
12681270
}
12691271

1270-
void perfdata_cb(const git_checkout_perfdata *in, void *payload)
1272+
static void perfdata_cb(const git_checkout_perfdata *in, void *payload)
12711273
{
12721274
memcpy(payload, in, sizeof(git_checkout_perfdata));
12731275
}
@@ -1296,7 +1298,7 @@ void test_checkout_tree__can_collect_perfdata(void)
12961298
git_object_free(obj);
12971299
}
12981300

1299-
void update_attr_callback(
1301+
static void update_attr_callback(
13001302
const char *path,
13011303
size_t completed_steps,
13021304
size_t total_steps,

tests/clone/nonetwork.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ void test_clone_nonetwork__fail_with_already_existing_but_non_empty_directory(vo
109109
cl_git_fail(git_clone(&g_repo, cl_git_fixture_url("testrepo.git"), "./foo", &g_options));
110110
}
111111

112-
int custom_origin_name_remote_create(
112+
static int custom_origin_name_remote_create(
113113
git_remote **out,
114114
git_repository *repo,
115115
const char *name,

tests/commit/commit.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ void test_commit_commit__create_initial_commit_parent_not_current(void)
111111
git_signature_free(s);
112112
}
113113

114-
void assert_commit_summary(const char *expected, const char *given)
114+
static void assert_commit_summary(const char *expected, const char *given)
115115
{
116116
git_commit *dummy;
117117

@@ -123,7 +123,7 @@ void assert_commit_summary(const char *expected, const char *given)
123123
git_commit__free(dummy);
124124
}
125125

126-
void assert_commit_body(const char *expected, const char *given)
126+
static void assert_commit_body(const char *expected, const char *given)
127127
{
128128
git_commit *dummy;
129129

tests/config/stress.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ void test_config_stress__dont_break_on_invalid_input(void)
3939
git_config_free(config);
4040
}
4141

42-
void assert_config_value(git_config *config, const char *key, const char *value)
42+
static void assert_config_value(git_config *config, const char *key, const char *value)
4343
{
4444
git_buf_dispose(&buf);
4545
cl_git_pass(git_config_get_string_buf(&buf, config, key));

tests/core/copy.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ void test_core_copy__file_in_dir(void)
4545
cl_assert(!git_fs_path_isdir("an_dir"));
4646
}
4747

48-
void assert_hard_link(const char *path)
48+
#ifndef GIT_WIN32
49+
static void assert_hard_link(const char *path)
4950
{
5051
/* we assert this by checking that there's more than one link to the file */
5152
struct stat st;
@@ -54,6 +55,7 @@ void assert_hard_link(const char *path)
5455
cl_git_pass(p_stat(path, &st));
5556
cl_assert(st.st_nlink > 1);
5657
}
58+
#endif
5759

5860
void test_core_copy__tree(void)
5961
{

tests/diff/binary.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ void test_diff_binary__cleanup(void)
1717
cl_git_sandbox_cleanup();
1818
}
1919

20-
void test_patch(
20+
static void test_patch(
2121
const char *one,
2222
const char *two,
2323
const git_diff_options *opts,

tests/diff/rename.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -938,7 +938,7 @@ struct rename_expected
938938
size_t idx;
939939
};
940940

941-
int test_names_expected(const git_diff_delta *delta, float progress, void *p)
941+
static int test_names_expected(const git_diff_delta *delta, float progress, void *p)
942942
{
943943
struct rename_expected *expected = p;
944944

tests/diff/tree.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ void test_diff_tree__checks_options_version(void)
320320
err = git_error_last();
321321
}
322322

323-
void process_tree_to_tree_diffing(
323+
static void process_tree_to_tree_diffing(
324324
const char *old_commit,
325325
const char *new_commit)
326326
{

0 commit comments

Comments
 (0)