mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-01-19 14:13:34 +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';
|
||||
}
|
||||
var ref = fs.readFileSync(rootPath + "/HEAD", "utf-8");
|
||||
var refPath = rootPath + "/" + ref.substring(5, ref.indexOf("\n"));
|
||||
version = fs.readFileSync(refPath, "utf-8");
|
||||
if (ref.startsWith("ref: ")) {
|
||||
var refPath = rootPath + "/" + ref.substring(5, ref.indexOf("\n"));
|
||||
version = fs.readFileSync(refPath, "utf-8");
|
||||
} else {
|
||||
version = ref;
|
||||
}
|
||||
version = version.substring(0, 7);
|
||||
} catch(e) {
|
||||
console.warn("Can't get git version for server header\n" + e.message)
|
||||
|
|
Loading…
Reference in a new issue