#NEWLINE# def create_repository( repo_root , name ) : #NEWLINE# #INDENT# path = os . path . join ( repo_root , name ) #NEWLINE# hook_path = os . path . join ( path , 'hooks' , 'post-receive' ) #NEWLINE# os . makedirs ( path ) #NEWLINE# call ( 'git' , 'init' , '--bare' , path , silent = True ) #NEWLINE# with open ( hook_path , 'w' ) as f : #NEWLINE# #INDENT# f . write ( RECEIVE_HOOK ) #NEWLINE# #UNINDENT# call ( 'chmod' , '+x' , hook_path , silent = True ) #NEWLINE# call ( 'chown' , '-R' , 'git:git' , path , silent = True )