author | Jens Lehmann <Jens.Lehmann@web.de> | |
Mon, 18 Jan 2010 20:26:18 +0000 (21:26 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Tue, 19 Jan 2010 01:28:21 +0000 (17:28 -0800) | ||
commit | e3d42c4773bccebb50f01b108d20b06c6a11e615 | |
tree | 08850034e0df462aab65fc69cd4b36bed6048256 | tree | snapshot |
parent | f17a5d34948363087db94a1cb2c3c715c1ada2d8 | commit | diff |
Performance optimization for detection of modified submodules
In the worst case is_submodule_modified() got called three times for
each submodule. The information we got from scanning the whole
submodule tree the first time can be reused instead.
New parameters have been added to diff_change() and diff_addremove(),
the information is stored in a new member of struct diff_filespec. Its
value is then reused instead of calling is_submodule_modified() again.
When no explicit "-dirty" is needed in the output the call to
is_submodule_modified() is not necessary when the submodules HEAD
already disagrees with the ref of the superproject, as this alone
marks it as modified. To achieve that, get_stat_data() got an extra
argument.
Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
In the worst case is_submodule_modified() got called three times for
each submodule. The information we got from scanning the whole
submodule tree the first time can be reused instead.
New parameters have been added to diff_change() and diff_addremove(),
the information is stored in a new member of struct diff_filespec. Its
value is then reused instead of calling is_submodule_modified() again.
When no explicit "-dirty" is needed in the output the call to
is_submodule_modified() is not necessary when the submodules HEAD
already disagrees with the ref of the superproject, as this alone
marks it as modified. To achieve that, get_stat_data() got an extra
argument.
Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
diff-lib.c | diff | blob | history | |
diff.c | diff | blob | history | |
diff.h | diff | blob | history | |
diffcore.h | diff | blob | history | |
revision.c | diff | blob | history | |
tree-diff.c | diff | blob | history |