lib/repo: Add error prefixing during hardlink object import

I happened to have a repo with a missing commit object, and got an unprefixed
error during a pull-local.

Closes: #1129
Approved by: jlebon
This commit is contained in:
Colin Walters authored and Atomic Bot committed 2017-09-07 15:16:24 +00:00
1 parent 8ec76cf024
commit 732891efc2
1 file changed
+4 -1
+4 -1
View File
@@ -3350,6 +3350,9 @@ import_one_object_link (OstreeRepo *self,
GCancellable *cancellable, GCancellable *cancellable,
GError **error) GError **error)
{ {
const char *errprefix = glnx_strjoina ("Importing ", checksum, ".",
ostree_object_type_to_string (objtype));
GLNX_AUTO_PREFIX_ERROR (errprefix, error);
char loose_path_buf[_OSTREE_LOOSE_PATH_MAX]; char loose_path_buf[_OSTREE_LOOSE_PATH_MAX];
_ostree_loose_path (loose_path_buf, checksum, objtype, self->mode); _ostree_loose_path (loose_path_buf, checksum, objtype, self->mode);
@@ -3396,7 +3399,7 @@ import_one_object_link (OstreeRepo *self,
return TRUE; return TRUE;
} }
else else
return glnx_throw_errno (error); return glnx_throw_errno_prefix (error, "linkat");
} }
if (objtype == OSTREE_OBJECT_TYPE_COMMIT) if (objtype == OSTREE_OBJECT_TYPE_COMMIT)