Don’t raise an exception when encountered untracked file

This commit is contained in:
ZyX 2013-01-05 18:14:17 +04:00 committed by Kim Silkebækken
parent 332dc45bf9
commit 424da8b573
1 changed files with 4 additions and 1 deletions

View File

@ -25,7 +25,10 @@ try:
(except for merge statuses as they are not supported by libgit2).
'''
if path:
status = self._repo().status_file(path)
try:
status = self._repo().status_file(path)
except KeyError, ValueError:
return None
if status == git.GIT_STATUS_CURRENT:
return None