mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-01-31 19:02:59 +01:00
utils: Fix commit checking on detached HEAD
This commit is contained in:
parent
cb5fcbb74e
commit
bee1ae06d8
1 changed files with 6 additions and 2 deletions
|
@ -423,8 +423,12 @@ exports.getGitCommit = function() {
|
||||||
rootPath += '/.git';
|
rootPath += '/.git';
|
||||||
}
|
}
|
||||||
var ref = fs.readFileSync(rootPath + "/HEAD", "utf-8");
|
var ref = fs.readFileSync(rootPath + "/HEAD", "utf-8");
|
||||||
var refPath = rootPath + "/" + ref.substring(5, ref.indexOf("\n"));
|
if (ref.startsWith("ref: ")) {
|
||||||
version = fs.readFileSync(refPath, "utf-8");
|
var refPath = rootPath + "/" + ref.substring(5, ref.indexOf("\n"));
|
||||||
|
version = fs.readFileSync(refPath, "utf-8");
|
||||||
|
} else {
|
||||||
|
version = ref;
|
||||||
|
}
|
||||||
version = version.substring(0, 7);
|
version = version.substring(0, 7);
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
console.warn("Can't get git version for server header\n" + e.message)
|
console.warn("Can't get git version for server header\n" + e.message)
|
||||||
|
|
Loading…
Reference in a new issue