mirror of
https://git.proxmox.com/git/libgit2
synced 2025-08-13 17:21:09 +00:00
refs: Better error name
This commit is contained in:
parent
d6c8688dac
commit
a5de904427
@ -240,7 +240,7 @@ parse_failed:
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int loose_parse_oid(git_oid *oid, git_buf *file_content)
|
static int loose_parse_oid(git_oid *oid, const char *filename, git_buf *file_content)
|
||||||
{
|
{
|
||||||
size_t len;
|
size_t len;
|
||||||
const char *str;
|
const char *str;
|
||||||
@ -262,7 +262,7 @@ static int loose_parse_oid(git_oid *oid, git_buf *file_content)
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
corrupted:
|
corrupted:
|
||||||
giterr_set(GITERR_REFERENCE, "Corrupted loose reference file");
|
giterr_set(GITERR_REFERENCE, "Corrupted loose reference file: %s", filename);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -289,7 +289,7 @@ static int loose_lookup_to_packfile(
|
|||||||
memcpy(ref->name, name, name_len);
|
memcpy(ref->name, name, name_len);
|
||||||
ref->name[name_len] = 0;
|
ref->name[name_len] = 0;
|
||||||
|
|
||||||
if (loose_parse_oid(&ref->oid, &ref_file) < 0) {
|
if (loose_parse_oid(&ref->oid, name, &ref_file) < 0) {
|
||||||
git_buf_free(&ref_file);
|
git_buf_free(&ref_file);
|
||||||
git__free(ref);
|
git__free(ref);
|
||||||
return -1;
|
return -1;
|
||||||
@ -431,7 +431,7 @@ static int loose_lookup(
|
|||||||
|
|
||||||
*out = git_reference__alloc_symbolic(ref_name, target);
|
*out = git_reference__alloc_symbolic(ref_name, target);
|
||||||
} else {
|
} else {
|
||||||
if ((error = loose_parse_oid(&oid, &ref_file)) < 0)
|
if ((error = loose_parse_oid(&oid, ref_name, &ref_file)) < 0)
|
||||||
goto done;
|
goto done;
|
||||||
|
|
||||||
*out = git_reference__alloc(ref_name, &oid, NULL);
|
*out = git_reference__alloc(ref_name, &oid, NULL);
|
||||||
|
Loading…
Reference in New Issue
Block a user