Skip to content

Commit 5b3669e

Browse files
committed
Don't fail on import if the working dir isn't valid (#1319)
1 parent ea1a03a commit 5b3669e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

git/cmd.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -781,7 +781,10 @@ def execute(self,
781781
log.info(' '.join(redacted_command))
782782

783783
# Allow the user to have the command executed in their working dir.
784-
cwd = self._working_dir or os.getcwd()
784+
try:
785+
cwd = self._working_dir or os.getcwd() # type: Union[None, str]
786+
except FileNotFoundError:
787+
cwd = None
785788

786789
# Start the process
787790
inline_env = env

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy