Removed handling of pipe symbol (if available in git output).
This commit is contained in:
parent
0fb38013f7
commit
72cb738af5
@ -135,23 +135,41 @@ std::optional<QStringList> GitClient::gitDiff(QString const &commits) {
|
|||||||
if (c.execute(m_customerRepository)) { // execute command in local customerRepo
|
if (c.execute(m_customerRepository)) { // execute command in local customerRepo
|
||||||
QString s = c.getCommandResult().trimmed();
|
QString s = c.getCommandResult().trimmed();
|
||||||
QStringList lines = Update::split(s, '\n');
|
QStringList lines = Update::split(s, '\n');
|
||||||
|
|
||||||
|
qInfo() << QString(80, '*');
|
||||||
|
qInfo() << "GIT DIFF RESULT" << lines;
|
||||||
|
qInfo() << QString(80, '*');
|
||||||
|
|
||||||
QStringList fileNames;
|
QStringList fileNames;
|
||||||
// each line has the format "etc/psa_config/DC2C_print01.json | 1 +
|
// each line has the format "etc/psa_config/DC2C_print01.json | 1 +
|
||||||
// or the format "etc/psa_config/DC2C_print01.json (new) | 1 +
|
// or the format "etc/psa_config/DC2C_print01.json (new) | 1 +
|
||||||
// the filenames are relativ to the repository
|
// the filenames are relativ to the repository
|
||||||
for (int i = 0; i < lines.size(); ++i) {
|
for (int i = 0; i < lines.size(); ++i) {
|
||||||
// TODO: koennte auch (delete) kommen ?
|
QString const &line = lines.at(i);
|
||||||
int newIndex = lines.at(i).indexOf("(new)"); // for new files
|
int newIndex = line.indexOf("(new"); // for new files
|
||||||
// int goneIndex = lines.at(i).indexOf("(gone)"); // for removed files
|
int goneIndex = line.indexOf("(gone"); // for removed files
|
||||||
|
int modeIndex = line.indexOf("(mode");
|
||||||
|
// int pipeIndex = line.indexOf('|');
|
||||||
if (newIndex != -1) {
|
if (newIndex != -1) {
|
||||||
QString fileName = lines.at(i).mid(0, newIndex).trimmed();
|
QString file = line.left(newIndex).trimmed();
|
||||||
fileNames << fileName;
|
qInfo() << "FILE (NEW)" << file;
|
||||||
} else {
|
fileNames << file;
|
||||||
int pipeIndex = lines.at(i).indexOf('|');
|
} else
|
||||||
if (pipeIndex != -1) {
|
if (modeIndex != -1) {
|
||||||
QString fileName = lines.at(i).mid(0, pipeIndex).trimmed();
|
QString const file = line.left(modeIndex).trimmed();
|
||||||
fileNames << fileName;
|
qInfo() << "FILE (MODE)" << file;
|
||||||
}
|
fileNames << file;
|
||||||
|
} else
|
||||||
|
//if (pipeIndex != -1) {
|
||||||
|
// QString const file = line.left(pipeIndex).trimmed();
|
||||||
|
// qInfo() << "FILE (PIPE)" << file;
|
||||||
|
// fileNames << file;
|
||||||
|
//} else
|
||||||
|
if (goneIndex != -1) {
|
||||||
|
QString const file = line.left(goneIndex).trimmed();
|
||||||
|
qCritical() << QString(80, '*');
|
||||||
|
qCritical() << "FILE (GONE)" << file;
|
||||||
|
qCritical() << QString(80, '*');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!fileNames.isEmpty()) {
|
if (!fileNames.isEmpty()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user