Various fixes by pks-t · Pull Request #4018 · libgit2/libgit2 · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/graph.c
2 changes: 1 addition & 1 deletion src/odb_mempack.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ struct memobject {
git_oid oid;
size_t len;
git_otype type;
char data[];
char data[GIT_FLEX_ARRAY];
};

struct memory_packer_db {
Expand Down
4 changes: 3 additions & 1 deletion src/pack.c
Original file line number Diff line number Diff line change
Expand Up @@ -509,8 +509,10 @@ int git_packfile_resolve_header(
git_packfile_stream_free(&stream);
if (error < 0)
return error;
} else
} else {
*size_p = size;
base_offset = 0;
}

while (type == GIT_OBJ_OFS_DELTA || type == GIT_OBJ_REF_DELTA) {
curpos = base_offset;
Expand Down
2 changes: 1 addition & 1 deletion src/patch_generate.c
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ static int create_binary(
size_t b_datalen)
{
git_buf deflate = GIT_BUF_INIT, delta = GIT_BUF_INIT;
size_t delta_data_len;
size_t delta_data_len = 0;
int error;

/* The git_delta function accepts unsigned long only */
Expand Down
1 change: 0 additions & 1 deletion src/path.c
Original file line number Diff line number Diff line change
Expand Up @@ -1145,7 +1145,6 @@ int git_path_diriter_init(
unsigned int flags)
{
git_win32_path path_filter;
git_buf hack = {0};

static int is_win7_or_later = -1;
if (is_win7_or_later < 0)
Expand Down
2 changes: 1 addition & 1 deletion src/revwalk.c
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ static void mark_parents_uninteresting(git_commit_list_node *commit)


while (parents) {
git_commit_list_node *commit = git_commit_list_pop(&parents);
commit = git_commit_list_pop(&parents);

while (commit) {
if (commit->uninteresting)
Expand Down
10 changes: 5 additions & 5 deletions src/transports/smart_protocol.c
Original file line number Diff line number Diff line change
Expand Up @@ -412,12 +412,12 @@ int git_smart__negotiate_fetch(git_transport *transport, git_repository *repo, c

if (i % 20 == 0 && t->rpc) {
git_pkt_ack *pkt;
unsigned int i;
unsigned int j;

if ((error = git_pkt_buffer_wants(wants, count, &t->caps, &data)) < 0)
goto on_error;

git_vector_foreach(&t->common, i, pkt) {
git_vector_foreach(&t->common, j, pkt) {
if ((error = git_pkt_buffer_have(&pkt->oid, &data)) < 0)
goto on_error;
}
Expand All @@ -432,12 +432,12 @@ int git_smart__negotiate_fetch(git_transport *transport, git_repository *repo, c
/* Tell the other end that we're done negotiating */
if (t->rpc && t->common.length > 0) {
git_pkt_ack *pkt;
unsigned int i;
unsigned int j;

if ((error = git_pkt_buffer_wants(wants, count, &t->caps, &data)) < 0)
goto on_error;

git_vector_foreach(&t->common, i, pkt) {
git_vector_foreach(&t->common, j, pkt) {
if ((error = git_pkt_buffer_have(&pkt->oid, &data)) < 0)
goto on_error;
}
Expand Down Expand Up @@ -728,7 +728,7 @@ static int add_push_report_pkt(git_push *push, git_pkt *pkt)
static int add_push_report_sideband_pkt(git_push *push, git_pkt_data *data_pkt, git_buf *data_pkt_buf)
{
git_pkt *pkt;
const char *line, *line_end;
const char *line, *line_end = NULL;
size_t line_len;
int error;
int reading_from_buf = data_pkt_buf->size > 0;
Expand Down
2 changes: 1 addition & 1 deletion tests/clar_libgit2.h