Skip to content

Commit 88a73f4

Browse files
Neha SinglaHaudinFlorence
authored andcommitted
Add environment variable inheritance to git status and branch API calls
1 parent 861374f commit 88a73f4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

jupyterlab_git/git.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ async def status(self, path: str) -> dict:
491491
Execute git status command & return the result.
492492
"""
493493
cmd = ["git", "status", "--porcelain", "-b", "-u", "-z"]
494-
code, status, my_error = await self.__execute(cmd, cwd=path)
494+
code, status, my_error = await self.__execute(cmd, cwd=path, env=os.environ.copy())
495495

496496
if code != 0:
497497
return {
@@ -839,7 +839,7 @@ async def branch_heads(self, path):
839839
"refs/heads/",
840840
]
841841

842-
code, output, error = await self.__execute(cmd, cwd=path)
842+
code, output, error = await self.__execute(cmd, cwd=path, env=os.environ.copy())
843843
if code != 0:
844844
return {"code": code, "command": " ".join(cmd), "message": error}
845845

@@ -905,7 +905,7 @@ async def branch_remotes(self, path):
905905
"refs/remotes/",
906906
]
907907

908-
code, output, error = await self.__execute(cmd, cwd=path)
908+
code, output, error = await self.__execute(cmd, cwd=path, env=os.environ.copy())
909909
if code != 0:
910910
return {"code": code, "command": " ".join(cmd), "message": error}
911911

0 commit comments

Comments
 (0)