+
Skip to content

diff: setup pager only before diff contents truly ready #1817

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
8 changes: 6 additions & 2 deletions builtin/diff.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ static void builtin_diff_b_f(struct rev_info *revs,
1, 0,
blob[0]->path ? blob[0]->path : path,
path);
setup_diff_pager(&revs->diffopt);
diffcore_std(&revs->diffopt);
diff_flush(&revs->diffopt);
}
Expand All @@ -129,6 +130,7 @@ static void builtin_diff_blobs(struct rev_info *revs,
&blob[0]->item->oid, &blob[1]->item->oid,
1, 1,
blob_path(blob[0]), blob_path(blob[1]));
setup_diff_pager(&revs->diffopt);
diffcore_std(&revs->diffopt);
diff_flush(&revs->diffopt);
}
Expand Down Expand Up @@ -164,6 +166,7 @@ static void builtin_diff_index(struct rev_info *revs,
} else if (repo_read_index(the_repository) < 0) {
die_errno("repo_read_cache");
}
setup_diff_pager(&revs->diffopt);
run_diff_index(revs, option);
}

Expand Down Expand Up @@ -201,6 +204,7 @@ static void builtin_diff_tree(struct rev_info *revs,
oid[swap] = &ent0->item->oid;
oid[1 - swap] = &ent1->item->oid;
}
setup_diff_pager(&revs->diffopt);
diff_tree_oid(oid[0], oid[1], "", &revs->diffopt);
log_tree_diff_flush(revs);
}
Expand All @@ -227,6 +231,7 @@ static void builtin_diff_combined(struct rev_info *revs,
if (i != first_non_parent)
oid_array_append(&parents, &ent[i].item->oid);
}
setup_diff_pager(&revs->diffopt);
diff_tree_combined(&ent[first_non_parent].item->oid, &parents, revs);
oid_array_clear(&parents);
}
Expand Down Expand Up @@ -283,6 +288,7 @@ static void builtin_diff_files(struct rev_info *revs, int argc, const char **arg
0) < 0) {
die_errno("repo_read_index_preload");
}
setup_diff_pager(&revs->diffopt);
run_diff_files(revs, options);
}

Expand Down Expand Up @@ -523,8 +529,6 @@ int cmd_diff(int argc,
rev.diffopt.flags.recursive = 1;
rev.diffopt.rotate_to_strict = 1;

setup_diff_pager(&rev.diffopt);

/*
* Do we have --cached and not have a pending object, then
* default to HEAD by hand. Eek.
Expand Down
Loading
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载