summaryrefslogtreecommitdiff
path: root/archive.c
diff options
context:
space:
mode:
Diffstat (limited to 'archive.c')
-rw-r--r--archive.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/archive.c b/archive.c
index 3c266d1..d571249 100644
--- a/archive.c
+++ b/archive.c
@@ -185,13 +185,13 @@ static int write_archive_entry(const struct object_id *oid, const char *base,
buffer = object_file_to_archive(args, path.buf, oid, mode, &type, &size);
if (!buffer)
- return error(_("cannot read %s"), oid_to_hex(oid));
+ return error(_("cannot read '%s'"), oid_to_hex(oid));
err = write_entry(args, oid, path.buf, path.len, mode, buffer, size);
free(buffer);
return err;
}
-static void queue_directory(const unsigned char *sha1,
+static void queue_directory(const struct object_id *oid,
struct strbuf *base, const char *filename,
unsigned mode, struct archiver_context *c)
{
@@ -203,7 +203,7 @@ static void queue_directory(const unsigned char *sha1,
d->mode = mode;
c->bottom = d;
d->len = xsnprintf(d->path, len, "%.*s%s/", (int)base->len, base->buf, filename);
- oidread(&d->oid, sha1);
+ oidcpy(&d->oid, oid);
}
static int write_directory(struct archiver_context *c)
@@ -250,8 +250,7 @@ static int queue_or_write_archive_entry(const struct object_id *oid,
if (check_attr_export_ignore(check))
return 0;
- queue_directory(oid->hash, base, filename,
- mode, c);
+ queue_directory(oid, base, filename, mode, c);
return READ_TREE_RECURSIVE;
}
@@ -339,7 +338,7 @@ int write_archive_entries(struct archiver_args *args,
strbuf_reset(&content);
if (strbuf_read_file(&content, path, info->stat.st_size) < 0)
- err = error_errno(_("could not read '%s'"), path);
+ err = error_errno(_("cannot read '%s'"), path);
else
err = write_entry(args, &fake_oid, path_in_archive.buf,
path_in_archive.len,
@@ -578,11 +577,11 @@ static int parse_archive_args(int argc, const char **argv,
if (remote)
die(_("Unexpected option --remote"));
if (exec)
- die(_("Option --exec can only be used together with --remote"));
+ die(_("the option '%s' requires '%s'"), "--exec", "--remote");
if (output)
die(_("Unexpected option --output"));
if (is_remote && args->extra_files.nr)
- die(_("Options --add-file and --remote cannot be used together"));
+ die(_("options '%s' and '%s' cannot be used together"), "--add-file", "--remote");
if (!base)
base = "";