Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 4 additions & 9 deletions GitUpKit/Core/GCHistory.m
Original file line number Diff line number Diff line change
Expand Up @@ -901,20 +901,18 @@ - (BOOL)_reloadHistory:(GCHistory*)history
// Configure commit tree walker to start from tips
CALL_LIBGIT2_FUNCTION_GOTO(cleanup, git_revwalk_new, &walker, self.private);
git_revwalk_sorting(walker, GIT_SORT_NONE);
git_revwalk_add_hide_block(walker, ^int(const git_oid *commit_id) {
return CFDictionaryContainsKey(lookup, commit_id);
});
if (historyTips) {
for (GCCommit* tip in tips) {
if (![historyTips containsObject:tip]) {
const git_oid* oid = git_commit_id(tip.private);
if (CFDictionaryContainsKey(lookup, oid)) {
CALL_LIBGIT2_FUNCTION_GOTO(cleanup, git_revwalk_hide, walker, oid);
} else {
if (!CFDictionaryContainsKey(lookup, oid)) {
CALL_LIBGIT2_FUNCTION_GOTO(cleanup, git_revwalk_push, walker, oid);
}
}
}
for (GCCommit* historyTip in historyTips) {
CALL_LIBGIT2_FUNCTION_GOTO(cleanup, git_revwalk_hide, walker, git_commit_id(historyTip.private));
}
} else {
for (GCCommit* tip in tips) {
CALL_LIBGIT2_FUNCTION_GOTO(cleanup, git_revwalk_push, walker, git_commit_id(tip.private));
Expand All @@ -929,9 +927,6 @@ - (BOOL)_reloadHistory:(GCHistory*)history
break;
}
CHECK_LIBGIT2_FUNCTION_CALL(goto cleanup, status, == GIT_OK);
if (historyTips && CFDictionaryContainsKey(lookup, &oid)) {
continue;
}
git_commit* walkCommit;
CALL_LIBGIT2_FUNCTION_GOTO(cleanup, git_commit_lookup, &walkCommit, self.private, &oid);
GCHistoryCommit* commit = [[GCHistoryCommit alloc] initWithRepository:self commit:walkCommit autoIncrementID:nextAutoIncrementID++];
Expand Down