mirror of
https://github.com/kennethreitz-archive/gitx.git
synced 2026-06-05 23:40:18 +00:00
HistoryView: only add parents if parents array exists
This used to break if a commit had no parents. This wasn't noticed before because the breakage is only minor -- the only way you see it is because the detail view didn't scroll up afterwards.
This commit is contained in:
@@ -184,15 +184,18 @@ var loadCommit = function(commitObject, currentRef) {
|
||||
}
|
||||
}
|
||||
|
||||
// Scroll to top
|
||||
scroll(0, 0);
|
||||
|
||||
if (!commit.parents)
|
||||
return;
|
||||
|
||||
for (var i = 0; i < commit.parents.length; i++) {
|
||||
var newRow = $("commit_header").insertRow(-1);
|
||||
newRow.innerHTML = "<td class='property_name'>Parent:</td><td>" +
|
||||
"<a href='' onclick='selectCommit(this.innerHTML); return false;'>" +
|
||||
commit.parents[i] + "</a></td>";
|
||||
}
|
||||
|
||||
// Scroll to top
|
||||
scroll(0, 0);
|
||||
}
|
||||
|
||||
var showDiff = function() {
|
||||
|
||||
Reference in New Issue
Block a user