diff --git a/php/utils.php b/php/utils.php index 1850ced17a..086892b639 100644 --- a/php/utils.php +++ b/php/utils.php @@ -392,40 +392,3 @@ function run_mysql_command( $cmd, $arg_str, $pass ) { if ( $r ) exit( $r ); } - -/** - * Clone a Git repo into a directory - * - * @param string $clone_url Where the Git repo should be cloned from - * @param string $local_dir Where the local Git repo should live - * @return bool|WP_Error $result Output of the execution - */ -function git_clone( $clone_url, $local_dir ) { - - $results = array(); - exec( 'git clone ' . escapeshellarg( $clone_url ) . ' ' . $local_dir, $results, $return ); - - $git_result = array_pop( $results ); - if ( false !== stripos( $git_result, 'Cloning into' ) ) - return true; - else - return new \WP_Error( 'shell-fatal', $git_result ); -} - -/** - * Update a local Git repo - * - * @param string $local_dir Where the local Git repo lives - * @return bool|WP_Error $result Output of the execution - */ -function git_pull( $local_dir ) { - - $results = array(); - exec( 'cd ' . escapeshellarg( $local_dir ) . '; git pull origin master', $results, $return ); - - $git_result = array_pop( $results ); - if ( false !== stripos( $git_result, 'Unpacking objects:' ) || false !== stripos( $git_result, 'Already up-to-date' ) ) - return true; - else - return new \WP_Error( 'shell-fatal', $git_result ); -} \ No newline at end of file