Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 5b3669e

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

1 file changed

+4-1Lines changed: 4 additions & 1 deletion

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎git/cmd.py‎

Copy file name to clipboardExpand all lines: git/cmd.py
+4-1Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.