mirror of
https://github.com/romkatv/powerlevel10k.git
synced 2025-12-11 22:02:32 +01:00
Merge commit 'ba83466e1d'
This commit is contained in:
commit
f217e4a39a
11 changed files with 97 additions and 59 deletions
|
|
@ -41,6 +41,10 @@ namespace {
|
|||
|
||||
using namespace std::string_literals;
|
||||
|
||||
void Truncate(std::string& s, size_t max_len) {
|
||||
if (s.size() > max_len) s.resize(max_len);
|
||||
}
|
||||
|
||||
void ProcessRequest(const Options& opts, RepoCache& cache, Request req) {
|
||||
Timer timer;
|
||||
ON_SCOPE_EXIT(&) { timer.Report("request"); };
|
||||
|
|
@ -167,6 +171,11 @@ void ProcessRequest(const Options& opts, RepoCache& cache, Request req) {
|
|||
// The number of files in the index with assume-unchanged bit set.
|
||||
resp.Print(stats.num_assume_unchanged);
|
||||
|
||||
CommitMessage msg = head_target ? GetCommitMessage(repo->repo(), *head_target) : CommitMessage();
|
||||
Truncate(msg.summary, opts.max_commit_summary_length);
|
||||
resp.Print(msg.encoding);
|
||||
resp.Print(msg.summary);
|
||||
|
||||
resp.Dump("with git status");
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue