Skip to content

Commit efb432c

Browse files
author
Edward Thomson
committed
Merge pull request libgit2#3801 from ethomson/warning
cleanup: unused warning
2 parents 37dba1a + 14cf05d commit efb432c

File tree

5 files changed

+11
-9
lines changed

5 files changed

+11
-9
lines changed

src/commit.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ void git_commit__free(void *_commit)
4040

4141
static int git_commit__create_buffer_internal(
4242
git_buf *out,
43-
git_repository *repo,
4443
const git_signature *author,
4544
const git_signature *committer,
4645
const char *message_encoding,
@@ -51,7 +50,7 @@ static int git_commit__create_buffer_internal(
5150
size_t i = 0;
5251
const git_oid *parent;
5352

54-
assert(out && repo && tree);
53+
assert(out && tree);
5554

5655
git_oid__writebuf(out, "tree ", tree);
5756

@@ -150,7 +149,7 @@ static int git_commit__create_internal(
150149
if ((error = validate_tree_and_parents(&parents, repo, tree, parent_cb, parent_payload, current_id, validate)) < 0)
151150
goto cleanup;
152151

153-
error = git_commit__create_buffer_internal(&buf, repo, author, committer,
152+
error = git_commit__create_buffer_internal(&buf, author, committer,
154153
message_encoding, message, tree,
155154
&parents);
156155

@@ -813,7 +812,7 @@ int git_commit_create_buffer(git_buf *out,
813812
return error;
814813

815814
error = git_commit__create_buffer_internal(
816-
out, repo, author, committer,
815+
out, author, committer,
817816
message_encoding, message, tree_id,
818817
&parents_arr);
819818

src/filebuf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ static int lock_file(git_filebuf *file, int flags, mode_t mode)
7070
git_file source;
7171
char buffer[FILEIO_BUFSIZE];
7272
ssize_t read_bytes;
73-
int error;
73+
int error = 0;
7474

7575
source = p_open(file->path_original, O_RDONLY);
7676
if (source < 0) {

src/global.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,9 @@ void git__free_tls_data(void)
228228

229229
BOOL WINAPI DllMain(HINSTANCE hInstDll, DWORD fdwReason, LPVOID lpvReserved)
230230
{
231+
GIT_UNUSED(hInstDll);
232+
GIT_UNUSED(lpvReserved);
233+
231234
/* This is how Windows lets us know our thread is being shut down */
232235
if (fdwReason == DLL_THREAD_DETACH) {
233236
git__free_tls_data();

src/rebase.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1047,15 +1047,12 @@ static int rebase_commit_inmemory(
10471047
const char *message_encoding,
10481048
const char *message)
10491049
{
1050-
git_rebase_operation *operation;
10511050
git_commit *commit = NULL;
10521051
int error = 0;
10531052

1054-
operation = git_array_get(rebase->operations, rebase->current);
1055-
1056-
assert(operation);
10571053
assert(rebase->index);
10581054
assert(rebase->last_commit);
1055+
assert(rebase->current < rebase->operations.size);
10591056

10601057
if ((error = rebase_commit__create(&commit, rebase, rebase->index,
10611058
rebase->last_commit, author, committer, message_encoding, message)) < 0)

tests/checkout/typechange.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,9 @@ static int make_submodule_dirty(git_submodule *sm, const char *name, void *paylo
229229
git_buf dirtypath = GIT_BUF_INIT;
230230
git_repository *submodule_repo;
231231

232+
GIT_UNUSED(name);
233+
GIT_UNUSED(payload);
234+
232235
/* remove submodule directory in preparation for init and repo_init */
233236
cl_git_pass(git_buf_joinpath(
234237
&submodulepath,

0 commit comments

Comments
 (0)