Skip to content

Conversation

nsingl00
Copy link

Several git subprocess calls in the status and branch APIs were not inheriting the parent process environment variables, which could cause git commands to fail when custom environment configurations are needed (e.g., custom PATH, GIT_*
variables, proxy settings, or authentication tokens).

Added env=os.environ.copy() parameter to the following subprocess calls:

  • Status API (git.py:status() method):
  • Branch API:

Issue: #1416

Copy link

Binder 👈 Launch a Binder on branch nsingl00/jupyterlab-git/main

Copy link
Member

@krassowski krassowski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general the pattern we use in the codebase is:

env = os.environ.copy()
env["GIT_TERMINAL_PROMPT"] = "0"

but I think these commands should not prompt so I think it is fine to merge as-is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

Git Status and Branch APIs Don't Use Current Environment Variables - Missing os.environ.copy()
2 participants