Skip to content

Commit

Permalink
WebHistoryView: Fix displaying of parents
Browse files Browse the repository at this point in the history
This was broken once with the shift away from Prototype,
and even further when using libgit2.
  • Loading branch information
pieter committed Dec 1, 2008
1 parent 35f20cd commit 4591557
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion PBGitHistoryController.m
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ - (IBAction) refresh: sender

- (void) selectCommit: (NSString*) commit
{
NSPredicate* selection = [NSPredicate predicateWithFormat:@"sha == %@", commit];
NSPredicate* selection = [NSPredicate predicateWithFormat:@"realSha == %@", commit];
NSArray* selectedCommits = [repository.revisionList.commits filteredArrayUsingPredicate:selection];
[commitController setSelectedObjects: selectedCommits];
int index = [[commitController selectionIndexes] firstIndex];
Expand Down
10 changes: 6 additions & 4 deletions html/views/history/history.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,15 +155,17 @@ var loadCommit = function(commitObject, currentRef) {
$("date").innerHTML = ""
showRefs();

for (var i = 0; i < commitHeader.rows.length; i++) {
for (var i = 0; i < $("commit_header").rows.length; ++i) {
var row = $("commit_header").rows[i];
if (row.innerHTML.match(/Parent:/))
if (row.innerHTML.match(/Parent:/)) {
row.parentNode.removeChild(row);
--i;
}
}

for (var i = 0; i < commit.parents; i++) {
for (var i = 0; i < commit.parents.length; i++) {
var newRow = $("commit_header").insertRow(-1);
new_row.innerHTML = "<td class='property_name'>Parent:</td><td>" +
newRow.innerHTML = "<td class='property_name'>Parent:</td><td>" +
"<a href='' onclick='selectCommit(this.innerHTML); return false;'>" +
commit.parents[i] + "</a></td>";
}
Expand Down

0 comments on commit 4591557

Please sign in to comment.