mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-24 09:11:14 +00:00
refdb_fs: Only strstr the traits line
This commit is contained in:
parent
1022db2b68
commit
822645f629
@ -216,8 +216,13 @@ static int packed_load(refdb_fs_backend *backend)
|
|||||||
static const char *traits_header = "# pack-refs with: ";
|
static const char *traits_header = "# pack-refs with: ";
|
||||||
|
|
||||||
if (git__prefixcmp(buffer_start, traits_header) == 0) {
|
if (git__prefixcmp(buffer_start, traits_header) == 0) {
|
||||||
const char *traits = buffer_start + strlen(traits_header);
|
char *traits = (char *)buffer_start + strlen(traits_header);
|
||||||
const char *traits_end = strchr(traits, '\n');
|
char *traits_end = strchr(traits, '\n');
|
||||||
|
|
||||||
|
if (traits_end == NULL)
|
||||||
|
goto parse_failed;
|
||||||
|
|
||||||
|
*traits_end = '\0';
|
||||||
|
|
||||||
if (strstr(traits, " fully-peeled ") != NULL) {
|
if (strstr(traits, " fully-peeled ") != NULL) {
|
||||||
backend->peeling_mode = PEELING_FULL;
|
backend->peeling_mode = PEELING_FULL;
|
||||||
|
Loading…
Reference in New Issue
Block a user