summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2018-09-21 15:57:22 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-09-21 16:48:10 (GMT)
commit6afaf807859bd671a3f8e9101952e648a1a5e1a9 (patch)
treea952ca9617248345985fb272781b612a9690f7ba /builtin
parenta470beea39b91a0604aed9b99184df45c1d962d1 (diff)
downloadgit-6afaf807859bd671a3f8e9101952e648a1a5e1a9.zip
git-6afaf807859bd671a3f8e9101952e648a1a5e1a9.tar.gz
git-6afaf807859bd671a3f8e9101952e648a1a5e1a9.tar.bz2
diff.c: remove the_index dependency in textconv() functions
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin')
-rw-r--r--builtin/cat-file.c6
-rw-r--r--builtin/log.c3
2 files changed, 6 insertions, 3 deletions
diff --git a/builtin/cat-file.c b/builtin/cat-file.c
index 64ec174..8d97c84 100644
--- a/builtin/cat-file.c
+++ b/builtin/cat-file.c
@@ -113,7 +113,8 @@ static int cat_one_file(int opt, const char *exp_type, const char *obj_name,
die("git cat-file --textconv %s: <object> must be <sha1:path>",
obj_name);
- if (textconv_object(path, obj_context.mode, &oid, 1, &buf, &size))
+ if (textconv_object(the_repository, path, obj_context.mode,
+ &oid, 1, &buf, &size))
break;
/* else fallthrough */
@@ -305,7 +306,8 @@ static void print_object_or_die(struct batch_options *opt, struct expand_data *d
oid_to_hex(oid), data->rest);
} else if (opt->cmdmode == 'c') {
enum object_type type;
- if (!textconv_object(data->rest, 0100644, oid,
+ if (!textconv_object(the_repository,
+ data->rest, 0100644, oid,
1, &contents, &size))
contents = read_object_file(oid,
&type,
diff --git a/builtin/log.c b/builtin/log.c
index e094560..f32a07f 100644
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -507,7 +507,8 @@ static int show_blob_object(const struct object_id *oid, struct rev_info *rev, c
&oidc, &obj_context))
die(_("Not a valid object name %s"), obj_name);
if (!obj_context.path ||
- !textconv_object(obj_context.path, obj_context.mode, &oidc, 1, &buf, &size)) {
+ !textconv_object(the_repository, obj_context.path,
+ obj_context.mode, &oidc, 1, &buf, &size)) {
free(obj_context.path);
return stream_blob_to_fd(1, oid, NULL, 0);
}