#NEWLINE# def save_file( repo_path , file_path , contents , msg ) : #NEWLINE# #INDENT# tempdir = mkdtemp ( ) #NEWLINE# subprocess . check_call ( [ 'git' , 'clone' , repo_path , tempdir ] ) #NEWLINE# fp = open ( os . path . join ( tempdir , tempdir ) , 'w' ) #NEWLINE# fp . write ( contents ) #NEWLINE# fp . close ( ) #NEWLINE# subprocess . check_call ( [ 'git' , 'add' , file_path ] , cwd = tempdir ) #NEWLINE# subprocess . check_call ( [ 'git' , 'commit' , '-m' , msg ] , cwd = tempdir ) #NEWLINE# subprocess . check_call ( [ 'git' , 'push' ] , cwd = tempdir )