Skip to content

GIT_CONFIG is ignored #318

@technoweenie

Description

@technoweenie

The shell integration tests pass its custom git config values to a git clone through the GIT_CONFIG environment variable. One of the custom values is a credential.helper setting to a test-only credential helper that generates a username and password for any "127.0.0.1:PORT" git servers. This config is meant to be applied to test repos only.

As diagnosed here, it seems this isn't working with a git clone.

  1. $ GIT_CONFIG=path/to/config git clone
  2. Git runs fetch internally.
  3. As Git checks the files out, it calls git lfs smudge on each file.
  4. before downloading, Git LFS calls git credential.

It seems that the custom GIT_CONFIG is being dropped somewhere after step 2. I did try adding this to the commands/commands_smudge.go to see if Git is passing GIT_CONFIG:

    ++ out='Cloning into '\''clone'\''...
    panic: GIT_CONFIG ENV /Users/rick/github/git-lfs/test/remote/config-test-happy-path

So it looks like it's getting the value from Git properly.

A couple places to check:

  1. The git config loading code always runs git config -l. Instead, it should probably recognize GIT_CONFIG and use that.
  2. The git credential code builds a *os.Cmd without specifying the Env. The docs say that it should be passing the current process' env through, so in theory this should work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions