BugFix [master] system information git (#2499)
fix for if the .git folder is present but corrupt
This commit is contained in:
parent
82accaaf1c
commit
a4e9c70157
|
|
@ -132,6 +132,17 @@ $text['label-git_info']['uk'] = "Гіт інформація";
|
|||
$text['label-git_info']['de-at'] = "Git Informationen";
|
||||
$text['label-git_info']['it-it'] = "Informazioni Git";
|
||||
|
||||
$text['label-git_corrupted']['en-us'] = "Git data is corrupt";
|
||||
$text['label-git_corrupted']['es-cl'] = "Git datos es corrupto";
|
||||
$text['label-git_corrupted']['pt-pt'] = "Dados Git é corrupto";
|
||||
$text['label-git_corrupted']['fr-fr'] = "Données Git est corrompu";
|
||||
$text['label-git_corrupted']['pt-br'] = "Dados Git é corrupto";
|
||||
$text['label-git_corrupted']['pl'] = "Git danych jest uszkodzony";
|
||||
$text['label-git_corrupted']['sv-se'] = "Git uppgifter är korrupt";
|
||||
$text['label-git_corrupted']['uk'] = "Гіт дані пошкоджені";
|
||||
$text['label-git_corrupted']['de-at'] = "Git Daten ist beschädigt" ;
|
||||
$text['label-git_corrupted']['it-it'] = "Dati Git è corrotto";
|
||||
|
||||
$text['label-switch']['en-us'] = "Switch";
|
||||
$text['label-switch']['es-cl'] = "Cambiar";
|
||||
$text['label-switch']['pt-pt'] = "Interruptor";
|
||||
|
|
|
|||
|
|
@ -89,7 +89,17 @@ $document['title'] = $text['title-sys-status'];
|
|||
if(file_exists($git_path)){
|
||||
$git_exe = 'git';
|
||||
if (strtoupper(substr(PHP_OS, 0, 3)) === 'SUN') { $git_exe = shell_exec('which git'); }
|
||||
shell_exec($git_exe.' --git-dir='.$git_path.' fetch');
|
||||
exec($git_exe.' --git-dir='.$git_path.' fetch', $dummy, $returnCode);
|
||||
if($returnCode){
|
||||
echo "<tr>\n";
|
||||
echo " <td width='20%' class=\"vncell\" style='text-align: left;'>\n";
|
||||
echo " ".$text['label-git_info']."\n";
|
||||
echo " </td>\n";
|
||||
echo " <td class=\"row_style1\">\n";
|
||||
echo " ".$text['label-git_corrupted']."\n";
|
||||
echo " </td>\n";
|
||||
echo "</tr>\n";
|
||||
}else{
|
||||
$git_branch = shell_exec($git_exe.' --git-dir='.$git_path.' name-rev --name-only HEAD');
|
||||
rtrim($git_branch);
|
||||
$git_commit = shell_exec($git_exe.' --git-dir='.$git_path.' rev-parse HEAD');
|
||||
|
|
@ -115,6 +125,7 @@ $document['title'] = $text['title-sys-status'];
|
|||
echo " </td>\n";
|
||||
echo "</tr>\n";
|
||||
}
|
||||
}
|
||||
|
||||
echo "<tr>\n";
|
||||
echo " <td width='20%' class=\"vncell\" style='text-align: left;'>\n";
|
||||
|
|
|
|||
Loading…
Reference in New Issue