mirror of
https://git.proxmox.com/git/libgit2
synced 2025-08-05 20:42:32 +00:00
commit
92d19d1671
@ -219,7 +219,7 @@ GIT_EXTERN(unsigned int) git_index_caps(const git_index *index);
|
|||||||
* @param caps A combination of GIT_INDEXCAP values
|
* @param caps A combination of GIT_INDEXCAP values
|
||||||
* @return 0 on success, -1 on failure
|
* @return 0 on success, -1 on failure
|
||||||
*/
|
*/
|
||||||
GIT_EXTERN(int) git_index_set_caps(git_index *index, unsigned int caps);
|
GIT_EXTERN(int) git_index_set_caps(git_index *index, int caps);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update the contents of an existing index object in memory
|
* Update the contents of an existing index object in memory
|
||||||
|
@ -39,7 +39,7 @@ int git_attr_file__new(
|
|||||||
attrs->key = git_pool_malloc(attrs->pool, (uint32_t)len + 3);
|
attrs->key = git_pool_malloc(attrs->pool, (uint32_t)len + 3);
|
||||||
GITERR_CHECK_ALLOC(attrs->key);
|
GITERR_CHECK_ALLOC(attrs->key);
|
||||||
|
|
||||||
attrs->key[0] = '0' + from;
|
attrs->key[0] = '0' + (char)from;
|
||||||
attrs->key[1] = '#';
|
attrs->key[1] = '#';
|
||||||
memcpy(&attrs->key[2], path, len);
|
memcpy(&attrs->key[2], path, len);
|
||||||
attrs->key[len + 2] = '\0';
|
attrs->key[len + 2] = '\0';
|
||||||
|
@ -154,7 +154,7 @@ int git_buf_puts(git_buf *buf, const char *string)
|
|||||||
return git_buf_put(buf, string, strlen(string));
|
return git_buf_put(buf, string, strlen(string));
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char b64str[64] =
|
static const char b64str[] =
|
||||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
||||||
|
|
||||||
int git_buf_put_base64(git_buf *buf, const char *data, size_t len)
|
int git_buf_put_base64(git_buf *buf, const char *data, size_t len)
|
||||||
|
@ -132,7 +132,7 @@ int git_config_file_normalize_section(char *start, char *end)
|
|||||||
if (end && scan >= end)
|
if (end && scan >= end)
|
||||||
break;
|
break;
|
||||||
if (isalnum(*scan))
|
if (isalnum(*scan))
|
||||||
*scan = tolower(*scan);
|
*scan = (char)tolower(*scan);
|
||||||
else if (*scan != '-' || scan == start)
|
else if (*scan != '-' || scan == start)
|
||||||
return GIT_EINVALIDSPEC;
|
return GIT_EINVALIDSPEC;
|
||||||
}
|
}
|
||||||
@ -781,7 +781,7 @@ static int parse_section_header_ext(struct reader *reader, const char *line, con
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
git_buf_putc(&buf, c);
|
git_buf_putc(&buf, (char)c);
|
||||||
} while ((c = line[rpos++]) != ']');
|
} while ((c = line[rpos++]) != ']');
|
||||||
|
|
||||||
*section_name = git_buf_detach(&buf);
|
*section_name = git_buf_detach(&buf);
|
||||||
|
@ -440,7 +440,8 @@ static int diff_list_apply_options(
|
|||||||
|
|
||||||
/* If not given explicit `opts`, check `diff.xyz` configs */
|
/* If not given explicit `opts`, check `diff.xyz` configs */
|
||||||
if (!opts) {
|
if (!opts) {
|
||||||
diff->opts.context_lines = config_int(cfg, "diff.context", 3);
|
int context = config_int(cfg, "diff.context", 3);
|
||||||
|
diff->opts.context_lines = context >= 0 ? (uint16_t)context : 3;
|
||||||
|
|
||||||
/* add other defaults here */
|
/* add other defaults here */
|
||||||
}
|
}
|
||||||
|
10
src/index.c
10
src/index.c
@ -408,9 +408,9 @@ static int create_index_error(int error, const char *msg)
|
|||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
int git_index_set_caps(git_index *index, unsigned int caps)
|
int git_index_set_caps(git_index *index, int caps)
|
||||||
{
|
{
|
||||||
int old_ignore_case;
|
unsigned int old_ignore_case;
|
||||||
|
|
||||||
assert(index);
|
assert(index);
|
||||||
|
|
||||||
@ -438,7 +438,7 @@ int git_index_set_caps(git_index *index, unsigned int caps)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (old_ignore_case != index->ignore_case) {
|
if (old_ignore_case != index->ignore_case) {
|
||||||
git_index__set_ignore_case(index, index->ignore_case);
|
git_index__set_ignore_case(index, (bool)index->ignore_case);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@ -2092,7 +2092,7 @@ int git_index_add_all(
|
|||||||
|
|
||||||
/* check if path actually matches */
|
/* check if path actually matches */
|
||||||
if (!git_pathspec__match(
|
if (!git_pathspec__match(
|
||||||
&ps.pathspec, wd->path, no_fnmatch, ignorecase, &match, NULL))
|
&ps.pathspec, wd->path, no_fnmatch, (bool)ignorecase, &match, NULL))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* skip ignored items that are not already in the index */
|
/* skip ignored items that are not already in the index */
|
||||||
@ -2184,7 +2184,7 @@ static int index_apply_to_all(
|
|||||||
|
|
||||||
/* check if path actually matches */
|
/* check if path actually matches */
|
||||||
if (!git_pathspec__match(
|
if (!git_pathspec__match(
|
||||||
&ps.pathspec, entry->path, false, index->ignore_case,
|
&ps.pathspec, entry->path, false, (bool)index->ignore_case,
|
||||||
&match, NULL))
|
&match, NULL))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
@ -168,7 +168,6 @@ int git_odb__hashfd(git_oid *out, git_file fd, size_t size, git_otype type)
|
|||||||
error = -1;
|
error = -1;
|
||||||
|
|
||||||
goto done;
|
goto done;
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
error = git_hash_final(out, &ctx);
|
error = git_hash_final(out, &ctx);
|
||||||
@ -623,7 +622,7 @@ int git_odb_exists(git_odb *db, const git_oid *id)
|
|||||||
git_odb_backend *b = internal->backend;
|
git_odb_backend *b = internal->backend;
|
||||||
|
|
||||||
if (b->exists != NULL)
|
if (b->exists != NULL)
|
||||||
found = b->exists(b, id);
|
found = (bool)b->exists(b, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (int)found;
|
return (int)found;
|
||||||
|
@ -211,7 +211,7 @@ int git_oid_strcmp(const git_oid *oid_a, const char *str)
|
|||||||
for (a = oid_a->id; *str && (a - oid_a->id) < GIT_OID_RAWSZ; ++a) {
|
for (a = oid_a->id; *str && (a - oid_a->id) < GIT_OID_RAWSZ; ++a) {
|
||||||
if ((hexval = git__fromhex(*str++)) < 0)
|
if ((hexval = git__fromhex(*str++)) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
strval = hexval << 4;
|
strval = (unsigned char)(hexval << 4);
|
||||||
if (*str) {
|
if (*str) {
|
||||||
if ((hexval = git__fromhex(*str++)) < 0)
|
if ((hexval = git__fromhex(*str++)) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -362,7 +362,7 @@ cleanup:
|
|||||||
static int update_config_refspec(const git_remote *remote, git_config *config, int direction)
|
static int update_config_refspec(const git_remote *remote, git_config *config, int direction)
|
||||||
{
|
{
|
||||||
git_buf name = GIT_BUF_INIT;
|
git_buf name = GIT_BUF_INIT;
|
||||||
int push;
|
unsigned int push;
|
||||||
const char *dir;
|
const char *dir;
|
||||||
size_t i;
|
size_t i;
|
||||||
int error = 0;
|
int error = 0;
|
||||||
@ -1549,7 +1549,7 @@ int git_remote_add_push(git_remote *remote, const char *refspec)
|
|||||||
return add_refspec(remote, refspec, false);
|
return add_refspec(remote, refspec, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int copy_refspecs(git_strarray *array, git_remote *remote, int push)
|
static int copy_refspecs(git_strarray *array, git_remote *remote, unsigned int push)
|
||||||
{
|
{
|
||||||
size_t i;
|
size_t i;
|
||||||
git_vector refspecs;
|
git_vector refspecs;
|
||||||
|
@ -195,7 +195,7 @@ static int winhttp_stream_connect(winhttp_stream *s)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Set proxy if necessary */
|
/* Set proxy if necessary */
|
||||||
if (git_remote__get_http_proxy(t->owner->owner, t->use_ssl, &proxy_url) < 0)
|
if (git_remote__get_http_proxy(t->owner->owner, !!t->use_ssl, &proxy_url) < 0)
|
||||||
goto on_error;
|
goto on_error;
|
||||||
|
|
||||||
if (proxy_url) {
|
if (proxy_url) {
|
||||||
@ -939,7 +939,7 @@ static int winhttp_connect(
|
|||||||
t->connection = WinHttpConnect(
|
t->connection = WinHttpConnect(
|
||||||
t->session,
|
t->session,
|
||||||
host,
|
host,
|
||||||
port,
|
(INTERNET_PORT)port,
|
||||||
0);
|
0);
|
||||||
|
|
||||||
if (!t->connection) {
|
if (!t->connection) {
|
||||||
|
Loading…
Reference in New Issue
Block a user