summaryrefslogtreecommitdiff
path: root/unpack-trees.c
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2018-08-13 16:14:33 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-08-13 21:14:43 (GMT)
commitc4500e251f89cbbc49fe90b832348ea9d4899946 (patch)
treeb4d5fa523ffd904e1cc061172230d4af6e50f7ed /unpack-trees.c
parent74cfc0ee1d0b4e386b5a07f8b79fbcece94cdff8 (diff)
downloadgit-c4500e251f89cbbc49fe90b832348ea9d4899946.zip
git-c4500e251f89cbbc49fe90b832348ea9d4899946.tar.gz
git-c4500e251f89cbbc49fe90b832348ea9d4899946.tar.bz2
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 'unpack-trees.c')
-rw-r--r--unpack-trees.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/unpack-trees.c b/unpack-trees.c
index 14e9043..f25089b 100644
--- a/unpack-trees.c
+++ b/unpack-trees.c
@@ -353,7 +353,7 @@ static int check_updates(struct unpack_trees_options *o)
progress = get_progress(o);
if (o->update)
- git_attr_set_direction(GIT_ATTR_CHECKOUT, index);
+ git_attr_set_direction(GIT_ATTR_CHECKOUT);
if (should_update_submodules() && o->update && !o->dry_run)
load_gitmodules_file(index, NULL);
@@ -413,7 +413,7 @@ static int check_updates(struct unpack_trees_options *o)
stop_progress(&progress);
errs |= finish_delayed_checkout(&state);
if (o->update)
- git_attr_set_direction(GIT_ATTR_CHECKIN, NULL);
+ git_attr_set_direction(GIT_ATTR_CHECKIN);
return errs != 0;
}