#NEWLINE# def has_uncommitted_files( proj_dir ) : #NEWLINE# #INDENT# 'check whether a git repo has uncommitted files\n\n    :param proj_dir:    a git repo dir\n    :returns:           True/False and output string\n    ' #NEWLINE# try : #NEWLINE# #INDENT# output = subprocess . check_output ( 'git status -s' , cwd = proj_dir , shell = True ) #NEWLINE# if ( len ( output ) > 0 ) : #NEWLINE# #INDENT# return ( True , output ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return ( False , output ) #NEWLINE# #UNINDENT# #UNINDENT# except subprocess . CalledProcessError : #NEWLINE# #INDENT# log . error ( "failed to call 'git status -s'" ) #NEWLINE# return ( False , '' )