Merge pull request #1561 from arrbee/fix-windows-diff-eofnl Fix windows diff eofnl error
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 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113
diff --git a/src/diff.c b/src/diff.c
index e0dff9c..f466546 100644
--- a/src/diff.c
+++ b/src/diff.c
@@ -535,7 +535,7 @@ cleanup:
static bool diff_time_eq(
const git_index_time *a, const git_index_time *b, bool use_nanos)
{
- return a->seconds == a->seconds &&
+ return a->seconds == b->seconds &&
(!use_nanos || a->nanoseconds == b->nanoseconds);
}
diff --git a/src/remote.c b/src/remote.c
index 6925376..8a2982c 100644
--- a/src/remote.c
+++ b/src/remote.c
@@ -292,7 +292,7 @@ int git_remote_load(git_remote **out, git_repository *repo, const char *name)
git_buf_clear(&buf);
git_buf_printf(&buf, "remote.%s.pushurl", name);
- if ((error = get_optional_config(config, &buf, NULL, &val)) < 0)
+ if ((error = get_optional_config(config, &buf, NULL, (void *)&val)) < 0)
goto cleanup;
if (val) {
diff --git a/tests-clar/merge/trees/trivial.c b/tests-clar/merge/trees/trivial.c
index 7d8d2cb..e6096e2 100644
--- a/tests-clar/merge/trees/trivial.c
+++ b/tests-clar/merge/trees/trivial.c
@@ -67,7 +67,7 @@ static int merge_trivial(git_index **index, const char *ours, const char *theirs
static int merge_trivial_conflict_entrycount(git_index *index)
{
const git_index_entry *entry;
- size_t count = 0;
+ int count = 0;
size_t i;
for (i = 0; i < git_index_entrycount(index); i++) {
diff --git a/tests-clar/network/remote/remotes.c b/tests-clar/network/remote/remotes.c
index 4c24db8..21f27bc 100644
--- a/tests-clar/network/remote/remotes.c
+++ b/tests-clar/network/remote/remotes.c
@@ -118,13 +118,13 @@ void test_network_remote_remotes__add_fetchspec(void)
cl_git_pass(git_remote_add_fetch(_remote, "refs/*:refs/*"));
size++;
- cl_assert_equal_i(size, git_remote_refspec_count(_remote));
+ cl_assert_equal_i((int)size, (int)git_remote_refspec_count(_remote));
_refspec = git_remote_get_refspec(_remote, size - 1);
cl_assert_equal_s(git_refspec_src(_refspec), "refs/*");
cl_assert_equal_s(git_refspec_dst(_refspec), "refs/*");
cl_assert_equal_s(git_refspec_string(_refspec), "refs/*:refs/*");
- cl_assert_equal_i(_refspec->push, false);
+ cl_assert_equal_b(_refspec->push, false);
}
void test_network_remote_remotes__add_pushspec(void)
@@ -135,14 +135,14 @@ void test_network_remote_remotes__add_pushspec(void)
cl_git_pass(git_remote_add_push(_remote, "refs/*:refs/*"));
size++;
- cl_assert_equal_i(size, git_remote_refspec_count(_remote));
+ cl_assert_equal_i((int)size, (int)git_remote_refspec_count(_remote));
_refspec = git_remote_get_refspec(_remote, size - 1);
cl_assert_equal_s(git_refspec_src(_refspec), "refs/*");
cl_assert_equal_s(git_refspec_dst(_refspec), "refs/*");
cl_assert_equal_s(git_refspec_string(_refspec), "refs/*:refs/*");
- cl_assert_equal_i(_refspec->push, true);
+ cl_assert_equal_b(_refspec->push, true);
}
void test_network_remote_remotes__save(void)
@@ -169,12 +169,12 @@ void test_network_remote_remotes__save(void)
cl_git_pass(git_remote_load(&_remote, _repo, "upstream"));
cl_git_pass(git_remote_get_fetch_refspecs(&array, _remote));
- cl_assert_equal_i(1, array.count);
+ cl_assert_equal_i(1, (int)array.count);
cl_assert_equal_s(fetch_refspec, array.strings[0]);
git_strarray_free(&array);
cl_git_pass(git_remote_get_push_refspecs(&array, _remote));
- cl_assert_equal_i(1, array.count);
+ cl_assert_equal_i(1, (int)array.count);
cl_assert_equal_s(push_refspec, array.strings[0]);
cl_assert_equal_s(git_remote_url(_remote), "git://github.com/libgit2/libgit2");
cl_assert_equal_s(git_remote_pushurl(_remote), "git://github.com/libgit2/libgit2_push");
diff --git a/tests-clar/object/cache.c b/tests-clar/object/cache.c
index e06760e..b927b25 100644
--- a/tests-clar/object/cache.c
+++ b/tests-clar/object/cache.c
@@ -80,7 +80,7 @@ void test_object_cache__cache_everything(void)
cl_assert_equal_i(count + 1, (int)git_cache_size(&g_repo->objects));
}
- cl_assert_equal_i(i, git_cache_size(&g_repo->objects) - start);
+ cl_assert_equal_i(i, (int)git_cache_size(&g_repo->objects) - start);
git_odb_free(odb);
@@ -135,7 +135,7 @@ void test_object_cache__cache_no_blobs(void)
}
}
- cl_assert_equal_i(nonblobs, git_cache_size(&g_repo->objects) - start);
+ cl_assert_equal_i(nonblobs, (int)git_cache_size(&g_repo->objects) - start);
git_odb_free(odb);
}