diff options
Diffstat (limited to 'environment.c')
-rw-r--r-- | environment.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/environment.c b/environment.c index 8fa032f307..63ac38a46f 100644 --- a/environment.c +++ b/environment.c @@ -344,3 +344,18 @@ int use_optional_locks(void) { return git_env_bool(GIT_OPTIONAL_LOCKS_ENVIRONMENT, 1); } + +int print_sha1_ellipsis(void) +{ + /* + * Determine if the calling environment contains the variable + * GIT_PRINT_SHA1_ELLIPSIS set to "yes". + */ + static int cached_result = -1; /* unknown */ + + if (cached_result < 0) { + const char *v = getenv("GIT_PRINT_SHA1_ELLIPSIS"); + cached_result = (v && !strcasecmp(v, "yes")); + } + return cached_result; +} |