checkout: describe_detached_head: remove ellipsis after committish
[gitweb.git] / environment.c
index f1f934b6fddd101191a17b1bc1883da287793319..a3abdd3c586da99f0d48711a52fd0014f2699e85 100644 (file)
@@ -338,3 +338,23 @@ void reset_shared_repository(void)
 {
        need_shared_repository_from_config = 1;
 }
+
+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;
+}