diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2018-08-13 18:14:18 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-08-13 14:14:42 -0700 |
commit | ff7fe37b0530c0ddb5a88fe41b963b68b3f66127 (patch) | |
tree | 09af0bfce17b3d9658558f7456256505e284bde0 /diff.h | |
parent | 4dcd706fe4d52b6f01dad1890b3d2075855065a8 (diff) | |
download | git-ff7fe37b0530c0ddb5a88fe41b963b68b3f66127.tar.gz |
diff.c: move read_index() code back to the caller
This code is only needed for diff-tree (since f0c6b2a2fd ([PATCH]
Optimize diff-tree -[CM] --stdin - 2005-05-27)). Let the caller do the
preparation instead and avoid read_index() in diff.c code.
read_index() should be avoided (in addition to the_index) because it
uses get_index_file() underneath to get the path $GIT_DIR/index. This
effectively pulls the_repository in and may become the only reason to
pull a 'struct repository *' in diff.c. Let's keep the dependencies as
few as possible and kick it back to diff-tree.c
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 'diff.h')
-rw-r--r-- | diff.h | 1 |
1 files changed, 0 insertions, 1 deletions
@@ -312,7 +312,6 @@ void diff_change(struct diff_options *, struct diff_filepair *diff_unmerge(struct diff_options *, const char *path); #define DIFF_SETUP_REVERSE 1 -#define DIFF_SETUP_USE_CACHE 2 #define DIFF_SETUP_USE_SIZE_CACHE 4 /* |