mirror of
https://github.com/Kitware/CMake.git
synced 2026-03-17 09:11:36 -05:00
CTest: Use UTF-8 encoding for output from Git
This commit is contained in:
@@ -91,7 +91,8 @@ std::string cmCTestGIT::FindGitDir()
|
||||
std::string git_dir_line;
|
||||
OneLineParser rev_parse_out(this, "rev-parse-out> ", git_dir_line);
|
||||
OutputLogger rev_parse_err(this->Log, "rev-parse-err> ");
|
||||
if (this->RunChild(git_rev_parse, &rev_parse_out, &rev_parse_err)) {
|
||||
if (this->RunChild(git_rev_parse, &rev_parse_out, &rev_parse_err, CM_NULLPTR,
|
||||
cmProcessOutput::UTF8)) {
|
||||
git_dir = git_dir_line;
|
||||
}
|
||||
if (git_dir.empty()) {
|
||||
@@ -114,7 +115,8 @@ std::string cmCTestGIT::FindGitDir()
|
||||
0 };
|
||||
OneLineParser cygpath_out(this, "cygpath-out> ", git_dir_line);
|
||||
OutputLogger cygpath_err(this->Log, "cygpath-err> ");
|
||||
if (this->RunChild(cygpath, &cygpath_out, &cygpath_err)) {
|
||||
if (this->RunChild(cygpath, &cygpath_out, &cygpath_err, CM_NULLPTR,
|
||||
cmProcessOutput::UTF8)) {
|
||||
git_dir = git_dir_line;
|
||||
}
|
||||
}
|
||||
@@ -134,7 +136,8 @@ std::string cmCTestGIT::FindTopDir()
|
||||
std::string cdup;
|
||||
OneLineParser rev_parse_out(this, "rev-parse-out> ", cdup);
|
||||
OutputLogger rev_parse_err(this->Log, "rev-parse-err> ");
|
||||
if (this->RunChild(git_rev_parse, &rev_parse_out, &rev_parse_err) &&
|
||||
if (this->RunChild(git_rev_parse, &rev_parse_out, &rev_parse_err, CM_NULLPTR,
|
||||
cmProcessOutput::UTF8) &&
|
||||
!cdup.empty()) {
|
||||
top_dir += "/";
|
||||
top_dir += cdup;
|
||||
@@ -624,7 +627,7 @@ void cmCTestGIT::LoadRevisions()
|
||||
|
||||
CommitParser out(this, "dt-out> ");
|
||||
OutputLogger err(this->Log, "dt-err> ");
|
||||
this->RunProcess(cp, &out, &err);
|
||||
this->RunProcess(cp, &out, &err, cmProcessOutput::UTF8);
|
||||
|
||||
// Send one extra zero-byte to terminate the last record.
|
||||
out.Process("", 1);
|
||||
@@ -641,14 +644,16 @@ void cmCTestGIT::LoadModifications()
|
||||
CM_NULLPTR };
|
||||
OutputLogger ui_out(this->Log, "ui-out> ");
|
||||
OutputLogger ui_err(this->Log, "ui-err> ");
|
||||
this->RunChild(git_update_index, &ui_out, &ui_err);
|
||||
this->RunChild(git_update_index, &ui_out, &ui_err, CM_NULLPTR,
|
||||
cmProcessOutput::UTF8);
|
||||
|
||||
// Use 'git diff-index' to get modified files.
|
||||
const char* git_diff_index[] = { git, "diff-index", "-z",
|
||||
"HEAD", "--", CM_NULLPTR };
|
||||
DiffParser out(this, "di-out> ");
|
||||
OutputLogger err(this->Log, "di-err> ");
|
||||
this->RunChild(git_diff_index, &out, &err);
|
||||
this->RunChild(git_diff_index, &out, &err, CM_NULLPTR,
|
||||
cmProcessOutput::UTF8);
|
||||
|
||||
for (std::vector<Change>::const_iterator ci = out.Changes.begin();
|
||||
ci != out.Changes.end(); ++ci) {
|
||||
|
||||
Reference in New Issue
Block a user