summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2018-09-21 15:57:31 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-09-21 16:48:11 (GMT)
commit58bf2a4cc7a929d2fe0ff30eda86fcec54aef0f8 (patch)
tree14a33e0559d194d11f89ac2cdf61789db64dffcb /builtin
parenta7edadda593e34243c1cd3b3db750d502acf9b83 (diff)
downloadgit-58bf2a4cc7a929d2fe0ff30eda86fcec54aef0f8.zip
git-58bf2a4cc7a929d2fe0ff30eda86fcec54aef0f8.tar.gz
git-58bf2a4cc7a929d2fe0ff30eda86fcec54aef0f8.tar.bz2
sha1-file.c: remove implicit dependency on the_index
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/difftool.c2
-rw-r--r--builtin/hash-object.c2
-rw-r--r--builtin/replace.c2
-rw-r--r--builtin/update-index.c2
4 files changed, 4 insertions, 4 deletions
diff --git a/builtin/difftool.c b/builtin/difftool.c
index cdd585c..e7023e3 100644
--- a/builtin/difftool.c
+++ b/builtin/difftool.c
@@ -112,7 +112,7 @@ static int use_wt_file(const char *workdir, const char *name,
int fd = open(buf.buf, O_RDONLY);
if (fd >= 0 &&
- !index_fd(&wt_oid, fd, &st, OBJ_BLOB, name, 0)) {
+ !index_fd(&the_index, &wt_oid, fd, &st, OBJ_BLOB, name, 0)) {
if (is_null_oid(oid)) {
oidcpy(oid, &wt_oid);
use = 1;
diff --git a/builtin/hash-object.c b/builtin/hash-object.c
index 9ada4f4..d6f06ea 100644
--- a/builtin/hash-object.c
+++ b/builtin/hash-object.c
@@ -40,7 +40,7 @@ static void hash_fd(int fd, const char *type, const char *path, unsigned flags,
if (fstat(fd, &st) < 0 ||
(literally
? hash_literally(&oid, fd, type, flags)
- : index_fd(&oid, fd, &st, type_from_string(type), path, flags)))
+ : index_fd(&the_index, &oid, fd, &st, type_from_string(type), path, flags)))
die((flags & HASH_WRITE_OBJECT)
? "Unable to add %s to database"
: "Unable to hash %s", path);
diff --git a/builtin/replace.c b/builtin/replace.c
index 4f05791..e0b16ad 100644
--- a/builtin/replace.c
+++ b/builtin/replace.c
@@ -295,7 +295,7 @@ static int import_object(struct object_id *oid, enum object_type type,
close(fd);
return -1;
}
- if (index_fd(oid, fd, &st, type, NULL, flags) < 0)
+ if (index_fd(&the_index, oid, fd, &st, type, NULL, flags) < 0)
return error(_("unable to write object to database"));
/* index_fd close()s fd for us */
}
diff --git a/builtin/update-index.c b/builtin/update-index.c
index fe84003..3086212 100644
--- a/builtin/update-index.c
+++ b/builtin/update-index.c
@@ -282,7 +282,7 @@ static int add_one_path(const struct cache_entry *old, const char *path, int len
fill_stat_cache_info(ce, st);
ce->ce_mode = ce_mode_from_stat(old, st->st_mode);
- if (index_path(&ce->oid, path, st,
+ if (index_path(&the_index, &ce->oid, path, st,
info_only ? 0 : HASH_WRITE_OBJECT)) {
discard_cache_entry(ce);
return -1;