tmp-objdir: put quarantine information in the environment
authorJeff King <peff@peff.net>
Mon, 3 Oct 2016 20:49:18 +0000 (16:49 -0400)
committerJunio C Hamano <gitster@pobox.com>
Mon, 10 Oct 2016 20:54:02 +0000 (13:54 -0700)
The presence of the GIT_QUARANTINE_PATH variable lets any
called programs know that they're operating in a temporary
object directory (and where that directory is).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
cache.h
tmp-objdir.c
diff --git a/cache.h b/cache.h
index 5d36ffa1f253d1c007bfa41be270593612d44a6e..c898a1dd7d5f5dd20ee8830bb7e91b620fb18423 100644 (file)
--- a/cache.h
+++ b/cache.h
@@ -433,6 +433,7 @@ static inline enum object_type object_type(unsigned int mode)
 #define GIT_GLOB_PATHSPECS_ENVIRONMENT "GIT_GLOB_PATHSPECS"
 #define GIT_NOGLOB_PATHSPECS_ENVIRONMENT "GIT_NOGLOB_PATHSPECS"
 #define GIT_ICASE_PATHSPECS_ENVIRONMENT "GIT_ICASE_PATHSPECS"
+#define GIT_QUARANTINE_ENVIRONMENT "GIT_QUARANTINE_PATH"
 
 /*
  * This environment variable is expected to contain a boolean indicating
index 9443868be1e0918d7855cd3e409941526adcefc9..780af8e7521bfe98269cb11d32ff0266dc76dea7 100644 (file)
@@ -147,6 +147,8 @@ struct tmp_objdir *tmp_objdir_create(void)
        env_append(&t->env, ALTERNATE_DB_ENVIRONMENT,
                   absolute_path(get_object_directory()));
        env_replace(&t->env, DB_ENVIRONMENT, absolute_path(t->path.buf));
+       env_replace(&t->env, GIT_QUARANTINE_ENVIRONMENT,
+                   absolute_path(t->path.buf));
 
        return t;
 }