Re: [PATCH/RFC] introduce GIT_WORK_TREE environment variable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Matthias Lederhofer <matled@xxxxxxx> wrote:
> +	git_config(git_setup_config);

When $GIT_DIR was not set and the repository is found as a .git
directory $GIT_DIR will be the full path to the .git directory when
calling git_config().  git_config() calls git_path() which calls
get_git_dir() which calls getenv("GIT_DIR").
I'm not sure this is defined behaviour at all:
    
    char *foo = getenv("FOO");
    unsetenv("FOO");

Does foo still point to the old content of the FOO environment
variable?  If it does get_git_dir() will always return the full path
to the repository directory.

I can think of two ways to solve this (in case this is a problem):
1. Add a function to environment.c which will cause setup_git_env to
   be called again (either directly or by setting all the pointers to
   NULL again).
2. Use git_config_from_file() instead of git_config().  This will
   probably duplicate code from git_config().
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]