mirror of
https://github.com/atom/atom.git
synced 2026-02-16 01:25:13 -05:00
Make sure that GitRepositoryProvider.repositoryForDirectorySync() returns null rather than throws.
The UI locks up if this method does not return.
This commit is contained in:
@@ -51,6 +51,14 @@ class GitRepositoryProvider
|
||||
# * {GitRepository} if the given directory has a Git repository.
|
||||
# * `null` if the given directory does not have a Git repository.
|
||||
repositoryForDirectorySync: (directory) ->
|
||||
# Ensure that this method does not throw.
|
||||
try
|
||||
@repositoryForDirectorySyncInternal(directory)
|
||||
catch e
|
||||
# TODO: Log error.
|
||||
null
|
||||
|
||||
repositoryForDirectorySyncInternal: (directory) ->
|
||||
# Only one GitRepository should be created for each .git folder. Therefore,
|
||||
# we must check directory and its parent directories to find the nearest
|
||||
# .git folder.
|
||||
|
||||
Reference in New Issue
Block a user