repository: delete ignore_env member
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>
Sat, 3 Mar 2018 11:35:58 +0000 (18:35 +0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 5 Mar 2018 19:14:04 +0000 (11:14 -0800)
This variable was added because the repo_set_gitdir() was created to
cover both submodule and main repos, but these two are initialized a
bit differently so ignore_env == 0 means main repo, while ignore_env
!= 0 is submodules.

Since the difference part (env variables) has been moved out of
repo_set_gitdir(), this function works the same way for both repo
types and ignore_env is not needed anymore.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
repository.c
repository.h
index 04d85a2869212d9b6aed1bb00e6733a68730825e..62f52f47fcaed32c4f14a9f76eb1e66e13d4046a 100644 (file)
@@ -140,8 +140,6 @@ static int repo_init(struct repository *repo,
        struct repository_format format;
        memset(repo, 0, sizeof(*repo));
 
-       repo->ignore_env = 1;
-
        if (repo_init_gitdir(repo, gitdir))
                goto error;
 
index 2bfbf762f398f81c6116b1aa18a459f9178aa727..e7127baffba019812e458477a34a4d9a80a67cdc 100644 (file)
@@ -75,15 +75,6 @@ struct repository {
        const struct git_hash_algo *hash_algo;
 
        /* Configurations */
-       /*
-        * Bit used during initialization to indicate if repository state (like
-        * the location of the 'objectdir') should be read from the
-        * environment.  By default this bit will be set at the begining of
-        * 'repo_init()' so that all repositories will ignore the environment.
-        * The exception to this is 'the_repository', which doesn't go through
-        * the normal 'repo_init()' process.
-        */
-       unsigned ignore_env:1;
 
        /* Indicate if a repository has a different 'commondir' from 'gitdir' */
        unsigned different_commondir:1;