#NEWLINE# def create_git_repo( self , repo_name = 'test git repo' , create_temp_repo = False ) : #NEWLINE# #INDENT# 'Create an git repository for tests. Return directory.\n\n        :param repo_name:\n        :type repo_name:\n        :param create_temp_repo: If true, create repository\n        :type create_temp_repo: bool\n        :returns: directory of svn repository\n        :rtype: string\n\n        ' #NEWLINE# repo_path = os . path . join ( self . TMP_DIR , 'gitrepo_{0}' . format ( uuid . uuid4 ( ) ) ) #NEWLINE# git_repo = create_repo ( ** { #NEWLINE# #INDENT# 'url' : ( 'git+file://' + os . path . join ( repo_path , repo_name ) ) , #NEWLINE# 'cwd' : self . TMP_DIR , #NEWLINE# 'name' : repo_name , #NEWLINE# #UNINDENT# } ) #NEWLINE# if create_temp_repo : #NEWLINE# #INDENT# os . mkdir ( repo_path ) #NEWLINE# run ( [ 'git' , 'init' , git_repo [ 'name' ] ] , cwd = repo_path ) #NEWLINE# self . assertTrue ( os . path . exists ( repo_path ) ) #NEWLINE# git_repo . obtain ( quiet = True ) #NEWLINE# testfile_filename = 'testfile.test' #NEWLINE# run ( [ 'touch' , testfile_filename ] , cwd = os . path . join ( repo_path , repo_name ) ) #NEWLINE# run ( [ 'git' , 'add' , testfile_filename ] , cwd = os . path . join ( repo_path , repo_name ) ) #NEWLINE# run ( [ 'git' , 'commit' , '-m' , ( 'a test file for %s' % git_repo [ 'name' ] ) ] , cwd = os . path . join ( repo_path , repo_name ) ) #NEWLINE# git_repo . update_repo ( ) #NEWLINE# #UNINDENT# return ( os . path . join ( repo_path , repo_name ) , git_repo )