From 7647a12b03d31e90cc2edd1546132bc0be973766 Mon Sep 17 00:00:00 2001 From: "Costa Tsaousis (ktsaou)" Date: Sun, 12 Feb 2017 14:05:53 +0200 Subject: [PATCH] when version.txt and internal version differ, use the internal one --- web/index.html | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/web/index.html b/web/index.html index 13aa53c6..7bba3f4d 100644 --- a/web/index.html +++ b/web/index.html @@ -2317,12 +2317,14 @@ }) .done(function(data) { data = data.replace(/(\r\n|\n|\r| |\t)/gm,""); - if(data.length !== 40) { - var c = getNetdataCommitIdFromVersion(); - if(c === null) versionLog('Cannot find the git commit id of netdata.'); - callback(c); + + var c = getNetdataCommitIdFromVersion(); + if(c !== null && data.length === 40 && data.substring(0, 7) !== c) { + versionLog('Installed files commit id and internal netdata git commit id do not match'); + data = c; } - else { + + if(data.length >= 7) { versionLog('Installed git commit id of netdata is ' + data); document.getElementById('netdataCommitId').innerHTML = data.substring(0, 7); callback(data); -- 2.39.2