summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorLibravatar Nguyễn Thái Ngọc Duy <pclouds@gmail.com>2018-08-13 18:14:33 +0200
committerLibravatar Junio C Hamano <gitster@pobox.com>2018-08-13 14:14:43 -0700
commitc4500e251f89cbbc49fe90b832348ea9d4899946 (patch)
treeb4d5fa523ffd904e1cc061172230d4af6e50f7ed /builtin
parententry.c: use the right index instead of the_index (diff)
downloadtgif-c4500e251f89cbbc49fe90b832348ea9d4899946.tar.xz
attr: remove index from git_attr_set_direction()
Since attr checking API now take the index, there's no need to set an index in advance with this call. Most call sites are straightforward because they either pass the_index or NULL (which defaults back to the_index previously). There's only one suspicious call site in unpack-trees.c where it sets a different index. This code in unpack-trees is about to check out entries from the new/temporary index after merging is done in it. The attributes will be used by entry.c code to do crlf conversion if needed. entry.c now respects struct checkout's istate field, and this field is correctly set in unpack-trees.c, there should be no regression from this change. 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/check-attr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/check-attr.c b/builtin/check-attr.c
index f7b59993d3..c05573ff9c 100644
--- a/builtin/check-attr.c
+++ b/builtin/check-attr.c
@@ -120,7 +120,7 @@ int cmd_check_attr(int argc, const char **argv, const char *prefix)
}
if (cached_attrs)
- git_attr_set_direction(GIT_ATTR_INDEX, NULL);
+ git_attr_set_direction(GIT_ATTR_INDEX);
doubledash = -1;
for (i = 0; doubledash < 0 && i < argc; i++) {