Optimizing function
This commit is contained in:
parent
0d4a31b2a7
commit
3d7022a7da
|
@ -989,7 +989,7 @@ if(!function_exists('output')){
|
||||||
|
|
||||||
if(!function_exists('is_git_repo')){
|
if(!function_exists('is_git_repo')){
|
||||||
function 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){
|
function find_git_repo($path){
|
||||||
if(dirname($path) == DIRECTORY_SEPARATOR){
|
if(dirname($path) == DIRECTORY_SEPARATOR){
|
||||||
return false;
|
return false;
|
||||||
}else if( is_dir(getcwd().DIRECTORY_SEPARATOR.".git") ){
|
|
||||||
return getcwd().DIRECTORY_SEPARATOR.".git";
|
|
||||||
}else if(is_dir(dirname($path).DIRECTORY_SEPARATOR.".git")){
|
}else if(is_dir(dirname($path).DIRECTORY_SEPARATOR.".git")){
|
||||||
return dirname($path).DIRECTORY_SEPARATOR.".git";
|
return dirname($path).DIRECTORY_SEPARATOR.".git";
|
||||||
}else{
|
}else{
|
||||||
|
|
Loading…
Reference in New Issue