aboutsummaryrefslogtreecommitdiff
path: root/diffcore.h
diff options
context:
space:
mode:
authorJens Lehmann <Jens.Lehmann@web.de>2010-01-18 21:26:18 +0100
committerJunio C Hamano <gitster@pobox.com>2010-01-18 17:28:21 -0800
commite3d42c4773bccebb50f01b108d20b06c6a11e615 (patch)
tree08850034e0df462aab65fc69cd4b36bed6048256 /diffcore.h
parentf17a5d34948363087db94a1cb2c3c715c1ada2d8 (diff)
downloadgit-e3d42c4773bccebb50f01b108d20b06c6a11e615.tar.gz
git-e3d42c4773bccebb50f01b108d20b06c6a11e615.tar.xz
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>
Diffstat (limited to 'diffcore.h')
-rw-r--r--diffcore.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/diffcore.h b/diffcore.h
index 5b634585e..66687c3fe 100644
--- a/diffcore.h
+++ b/diffcore.h
@@ -42,6 +42,7 @@ struct diff_filespec {
#define DIFF_FILE_VALID(spec) (((spec)->mode) != 0)
unsigned should_free : 1; /* data should be free()'ed */
unsigned should_munmap : 1; /* data should be munmap()'ed */
+ unsigned dirty_submodule : 1; /* For submodules: its work tree is dirty */
struct userdiff_driver *driver;
/* data should be considered "binary"; -1 means "don't know yet" */