summaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
authorLibravatar Robin Rosenberg <robin.rosenberg@dewire.com>2013-01-22 08:49:22 +0100
committerLibravatar Junio C Hamano <gitster@pobox.com>2013-01-22 09:33:16 -0800
commitc08e4d5b5cfa9f692cb8c81e5e9615e330f299c2 (patch)
tree98aed4694ad319a814d7545c9a130561dc5d71db /config.c
parentMerge branch 'maint' (diff)
downloadtgif-c08e4d5b5cfa9f692cb8c81e5e9615e330f299c2.tar.xz
Enable minimal stat checking
Specifically the fields uid, gid, ctime, ino and dev are set to zero by JGit. Other implementations, eg. Git in cygwin are allegedly also somewhat incompatible with Git For Windows and on *nix platforms the resolution of the timestamps may differ. Any stat checking by git will then need to check content, which may be very slow, particularly on Windows. Since mtime and size is typically enough we should allow the user to tell git to avoid checking these fields if they are set to zero in the index. This change introduces a core.checkstat config option where the the user can select to check all fields (default), or just size and the whole second part of mtime (minimal). Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'config.c')
-rw-r--r--config.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/config.c b/config.c
index 7b444b68ab..3f638e3c00 100644
--- a/config.c
+++ b/config.c
@@ -566,6 +566,12 @@ static int git_default_core_config(const char *var, const char *value)
trust_ctime = git_config_bool(var, value);
return 0;
}
+ if (!strcmp(var, "core.statinfo")) {
+ if (!strcasecmp(value, "default"))
+ check_stat = 1;
+ else if (!strcasecmp(value, "minimal"))
+ check_stat = 0;
+ }
if (!strcmp(var, "core.quotepath")) {
quote_path_fully = git_config_bool(var, value);