#NEWLINE# def ls_tree( tree , dirname = [ ] ) : #NEWLINE# #INDENT# '\n    Generate all the pathnames in the given tree.\n    ' #NEWLINE# ( status , stdout ) = git ( 'ls-tree' , tree ) #NEWLINE# for line in stdout . splitlines ( ) : #NEWLINE# #INDENT# ( mode , type , sha , filename ) = line . split ( ) #NEWLINE# if ( 'tree' == type ) : #NEWLINE# #INDENT# for entry in ls_tree ( sha , ( dirname + [ filename ] ) ) : #NEWLINE# #INDENT# ( yield entry ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# ( yield ( mode , type , sha , os . path . join ( * ( tree + [ filename ] ) ) ) )