Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVicent Marti <tanoku@gmail.com>2013-04-23 04:24:44 +0400
committerVicent Marti <tanoku@gmail.com>2013-04-23 04:24:44 +0400
commita5de9044270e29b2388185bec02d7c0de301e7d1 (patch)
tree3e93196ade0896fbc0cf67cde64afb34be9daa59 /src/refdb_fs.c
parentd6c8688daceefed29dcde40154726b76960665d1 (diff)
refs: Better error name
Diffstat (limited to 'src/refdb_fs.c')
-rw-r--r--src/refdb_fs.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/refdb_fs.c b/src/refdb_fs.c
index 742ac6260..2f2e67104 100644
--- a/src/refdb_fs.c
+++ b/src/refdb_fs.c
@@ -240,7 +240,7 @@ parse_failed:
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;
const char *str;
@@ -262,7 +262,7 @@ static int loose_parse_oid(git_oid *oid, git_buf *file_content)
return 0;
corrupted:
- giterr_set(GITERR_REFERENCE, "Corrupted loose reference file");
+ giterr_set(GITERR_REFERENCE, "Corrupted loose reference file: %s", filename);
return -1;
}
@@ -289,7 +289,7 @@ static int loose_lookup_to_packfile(
memcpy(ref->name, name, name_len);
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__free(ref);
return -1;
@@ -431,7 +431,7 @@ static int loose_lookup(
*out = git_reference__alloc_symbolic(ref_name, target);
} else {
- if ((error = loose_parse_oid(&oid, &ref_file)) < 0)
+ if ((error = loose_parse_oid(&oid, ref_name, &ref_file)) < 0)
goto done;
*out = git_reference__alloc(ref_name, &oid, NULL);