Optimizing function

This commit is contained in:
Hiago Hubert 2016-12-13 00:33:35 -03:00
parent 0d4a31b2a7
commit 3d7022a7da
1 changed files with 1 additions and 3 deletions

View File

@ -989,7 +989,7 @@ if(!function_exists('output')){
if(!function_exists('is_git_repo')){
function is_git_repo(){
return boolval( find_git_repo(dirname(__FILE__)) );
return boolval( find_git_repo(getcwd().DIRECTORY_SEPARATOR.".git") );
}
}
@ -997,8 +997,6 @@ if(!function_exists('find_git_repo')){
function find_git_repo($path){
if(dirname($path) == DIRECTORY_SEPARATOR){
return false;
}else if( is_dir(getcwd().DIRECTORY_SEPARATOR.".git") ){
return getcwd().DIRECTORY_SEPARATOR.".git";
}else if(is_dir(dirname($path).DIRECTORY_SEPARATOR.".git")){
return dirname($path).DIRECTORY_SEPARATOR.".git";
}else{