Skip to content

GIT_CONFIG is ignored #318

Closed
Closed

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.

Activity

  1. michael-k commented on Jun 18, 2015

    @michael-k
    Contributor

    The docs say that it should be passing the current process' env through

    The same should be true for the os.Cmd call to git config -l. git-config respects GIT_CONFIG.

  2. ttaylorr commented on Aug 12, 2016

    @ttaylorr
    Contributor

    Roadmappin' this.

    #1438

  3. technoweenie commented on Dec 1, 2016

    @technoweenie
    ContributorAuthor

    Re-opening after adding this to a GH Project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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