mirror of
https://github.com/b374k/b374k.git
synced 2024-09-13 03:03:42 +02:00
Optimizing function
This commit is contained in:
parent
0d4a31b2a7
commit
3d7022a7da
1 changed files with 1 additions and 3 deletions
|
@ -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{
|
||||
|
|
Loading…
Reference in a new issue