Junio C Hamano wrote:
> I do not
> know how things will break when the end user sets and exports it to
> the environment, and I do not think we would want to make any
> promise on how it works.
That's a reasonable desire, and it means it's a good thing we noticed
this before the envvar escaped to "master". People *will* use such
exposed interfaces unless they are clearly marked as internal. That's
just a fact of life.
Here's a rough patch to hopefully improve matters.
Longer term, it would be nice to have something like
GIT_IMPLICIT_WORK_TREE exposed to let scripts cache the result of the
search for .git. Maybe something like "GIT_BARE=(arbitrary value)"
would be a good interface.
Signed-off-by: Jonathan Nieder <jrnie...@gmail.com>
diff --git a/cache.h b/cache.h
index 59e5b53..8f92b6d 100644
@@ -377,7 +377,7 @@ static inline enum object_type object_type(unsigned int
* of this, but we use it internally to communicate to sub-processes that we
* are in a bare repo. If not set, defaults to true.
-#define GIT_IMPLICIT_WORK_TREE_ENVIRONMENT "GIT_IMPLICIT_WORK_TREE"
+#define GIT_IMPLICIT_WORK_TREE_ENVIRONMENT "GIT_INTERNAL_IMPLICIT_WORK_TREE"
* Repository-local GIT_* environment variables; these will be cleared
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html