mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-13 09:19:42 +00:00
bootstrap: fixed incorrect git hash detection when cwd is not the repo root
This commit is contained in:
parent
a908197907
commit
54de518634
@ -186,9 +186,10 @@ namespace pocketmine {
|
|||||||
$gitHash = str_repeat("00", 20);
|
$gitHash = str_repeat("00", 20);
|
||||||
|
|
||||||
if(\Phar::running(true) === ""){
|
if(\Phar::running(true) === ""){
|
||||||
if(Utils::execute("git rev-parse HEAD", $out) === 0 and $out !== false and strlen($out = trim($out)) === 40){
|
$gitPath = \pocketmine\PATH;
|
||||||
|
if(Utils::execute("git -C $gitPath rev-parse HEAD", $out) === 0 and $out !== false and strlen($out = trim($out)) === 40){
|
||||||
$gitHash = trim($out);
|
$gitHash = trim($out);
|
||||||
if(Utils::execute("git diff --quiet") === 1 or Utils::execute("git diff --cached --quiet") === 1){ //Locally-modified
|
if(Utils::execute("git -C $gitPath diff --quiet") === 1 or Utils::execute("git -C $gitPath diff --cached --quiet") === 1){ //Locally-modified
|
||||||
$gitHash .= "-dirty";
|
$gitHash .= "-dirty";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user