]> arthur.barton.de Git - netdata.git/commitdiff
when version.txt and internal version differ, use the internal one
authorCosta Tsaousis (ktsaou) <costa@tsaousis.gr>
Sun, 12 Feb 2017 12:05:53 +0000 (14:05 +0200)
committerCosta Tsaousis (ktsaou) <costa@tsaousis.gr>
Sun, 12 Feb 2017 12:05:53 +0000 (14:05 +0200)
web/index.html

index 13aa53c6e4d44ae4222f7518133f942a0fb92d53..7bba3f4d5ef465b5563991ec722d1f73f7d9b18f 100644 (file)
             })
             .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);