Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitLFS does not handle GIT_TERMINAL_PROMPT env #385

Open
chasse20 opened this issue Dec 30, 2019 · 1 comment
Open

GitLFS does not handle GIT_TERMINAL_PROMPT env #385

chasse20 opened this issue Dec 30, 2019 · 1 comment

Comments

@chasse20
Copy link

chasse20 commented Dec 30, 2019

Because git-lfs.exe (64bit) is spawned as a child process of git.exe, it appears to be incapable of inheriting the ENV variables that are passed into the exec function. This leads to zombie background processes/memory leaks for handling applications such as Github Desktop when you need to perform commands like git lfs locks asking for user authentication for HTTP repos. Github Desktop uses the GIT_TERMINAL_PROMPT=0 environment variable hack to avoid this for vanilla Git. It functions properly if authentication is provided.

A simple, albeit not the most efficient, solution is to perform an args.includes('lfs') check and have it handled differently.

@chasse20
Copy link
Author

chasse20 commented Dec 30, 2019

Actually, this might not even be in Dugite's wheelhouse. GIT_TERMINAL_PROMPT isn't respected at all by git-lfs no matter what version I try when calling from Node. The ENV is all reading correctly, and the GIT_TERMINAL_PROMPT does work if I run tests in the shell, so I'm unsure what's going on there.

I'm expanding the LFS functionality for Github Desktop, so I'm a little uneasy about there being a leak . My short-term hack solution (aside from assuming people have credentials setup), is going to involve using the stdin from the spawner to force-fail any login prompt if credentials are set.

@chasse20 chasse20 changed the title GitLFS does not receive ENV variables GitLFS does not handle GIT_TERMINAL_PROMPT env Jan 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant