Skip to content

Commit ddc5c05

Browse files
author
Vicent Martí
committed
Merge pull request libgit2#1561 from arrbee/fix-windows-diff-eofnl
Fix windows diff eofnl error
2 parents af79575 + eb05b11 commit ddc5c05

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

src/diff.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ int git_diff__oid_for_file(
535535
static bool diff_time_eq(
536536
const git_index_time *a, const git_index_time *b, bool use_nanos)
537537
{
538-
return a->seconds == a->seconds &&
538+
return a->seconds == b->seconds &&
539539
(!use_nanos || a->nanoseconds == b->nanoseconds);
540540
}
541541

src/remote.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ int git_remote_load(git_remote **out, git_repository *repo, const char *name)
292292
git_buf_clear(&buf);
293293
git_buf_printf(&buf, "remote.%s.pushurl", name);
294294

295-
if ((error = get_optional_config(config, &buf, NULL, &val)) < 0)
295+
if ((error = get_optional_config(config, &buf, NULL, (void *)&val)) < 0)
296296
goto cleanup;
297297

298298
if (val) {

tests-clar/merge/trees/trivial.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ static int merge_trivial(git_index **index, const char *ours, const char *theirs
6767
static int merge_trivial_conflict_entrycount(git_index *index)
6868
{
6969
const git_index_entry *entry;
70-
size_t count = 0;
70+
int count = 0;
7171
size_t i;
7272

7373
for (i = 0; i < git_index_entrycount(index); i++) {

tests-clar/network/remote/remotes.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -118,13 +118,13 @@ void test_network_remote_remotes__add_fetchspec(void)
118118
cl_git_pass(git_remote_add_fetch(_remote, "refs/*:refs/*"));
119119

120120
size++;
121-
cl_assert_equal_i(size, git_remote_refspec_count(_remote));
121+
cl_assert_equal_i((int)size, (int)git_remote_refspec_count(_remote));
122122

123123
_refspec = git_remote_get_refspec(_remote, size - 1);
124124
cl_assert_equal_s(git_refspec_src(_refspec), "refs/*");
125125
cl_assert_equal_s(git_refspec_dst(_refspec), "refs/*");
126126
cl_assert_equal_s(git_refspec_string(_refspec), "refs/*:refs/*");
127-
cl_assert_equal_i(_refspec->push, false);
127+
cl_assert_equal_b(_refspec->push, false);
128128
}
129129

130130
void test_network_remote_remotes__add_pushspec(void)
@@ -135,14 +135,14 @@ void test_network_remote_remotes__add_pushspec(void)
135135

136136
cl_git_pass(git_remote_add_push(_remote, "refs/*:refs/*"));
137137
size++;
138-
cl_assert_equal_i(size, git_remote_refspec_count(_remote));
138+
cl_assert_equal_i((int)size, (int)git_remote_refspec_count(_remote));
139139

140140
_refspec = git_remote_get_refspec(_remote, size - 1);
141141
cl_assert_equal_s(git_refspec_src(_refspec), "refs/*");
142142
cl_assert_equal_s(git_refspec_dst(_refspec), "refs/*");
143143
cl_assert_equal_s(git_refspec_string(_refspec), "refs/*:refs/*");
144144

145-
cl_assert_equal_i(_refspec->push, true);
145+
cl_assert_equal_b(_refspec->push, true);
146146
}
147147

148148
void test_network_remote_remotes__save(void)
@@ -169,12 +169,12 @@ void test_network_remote_remotes__save(void)
169169
cl_git_pass(git_remote_load(&_remote, _repo, "upstream"));
170170

171171
cl_git_pass(git_remote_get_fetch_refspecs(&array, _remote));
172-
cl_assert_equal_i(1, array.count);
172+
cl_assert_equal_i(1, (int)array.count);
173173
cl_assert_equal_s(fetch_refspec, array.strings[0]);
174174
git_strarray_free(&array);
175175

176176
cl_git_pass(git_remote_get_push_refspecs(&array, _remote));
177-
cl_assert_equal_i(1, array.count);
177+
cl_assert_equal_i(1, (int)array.count);
178178
cl_assert_equal_s(push_refspec, array.strings[0]);
179179
cl_assert_equal_s(git_remote_url(_remote), "git://github.com/libgit2/libgit2");
180180
cl_assert_equal_s(git_remote_pushurl(_remote), "git://github.com/libgit2/libgit2_push");

tests-clar/object/cache.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ void test_object_cache__cache_everything(void)
8080
cl_assert_equal_i(count + 1, (int)git_cache_size(&g_repo->objects));
8181
}
8282

83-
cl_assert_equal_i(i, git_cache_size(&g_repo->objects) - start);
83+
cl_assert_equal_i(i, (int)git_cache_size(&g_repo->objects) - start);
8484

8585
git_odb_free(odb);
8686

@@ -135,7 +135,7 @@ void test_object_cache__cache_no_blobs(void)
135135
}
136136
}
137137

138-
cl_assert_equal_i(nonblobs, git_cache_size(&g_repo->objects) - start);
138+
cl_assert_equal_i(nonblobs, (int)git_cache_size(&g_repo->objects) - start);
139139

140140
git_odb_free(odb);
141141
}

0 commit comments

Comments
 (0)