[PATCH qgit] Update to latest --early-output git log patch
From: Marco Costalba <hidden>
Date: 2016-06-15 22:43:47
Subsystem:
the rest · Maintainer:
Linus Torvalds
Fix broken implementation after Linus updated his early output patch to version with improve output format. Signed-off-by: Marco Costalba <redacted> --- src/git.h | 2 +- src/git_startup.cpp | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/git.h b/src/git.h
index 92879fb..789fea4 100644
--- a/src/git.h
+++ b/src/git.h@@ -251,7 +251,7 @@ private: bool startParseProc(SCList initCmd, FileHistory* fh, SCRef buf); bool tryFollowRenames(FileHistory* fh); bool populateRenamedPatches(SCRef sha, SCList nn, FileHistory* fh,
QStringList* on, bool bt); - void doEarlyOutput(Rev* rev, int* start); + void doEarlyOutput(Rev* rev, const QByteArray& ba, int* start); int addChunk(FileHistory* fh, const QByteArray& ba, int ofs); void parseDiffFormat(RevFile& rf, SCRef buf); void parseDiffFormatLine(RevFile& rf, SCRef line, int parNum);
diff --git a/src/git_startup.cpp b/src/git_startup.cpp
index df272fc..090d5f9 100644
--- a/src/git_startup.cpp
+++ b/src/git_startup.cpp@@ -841,10 +841,10 @@ void Git::loadFileNames() { indexTree(); } -void Git::doEarlyOutput(Rev* rev, int* start) { +void Git::doEarlyOutput(Rev* rev, const QByteArray& ba, int* start) { delete rev; - *start += QString("Final output:\n").length(); + *start = ba.indexOf('\n', *start) + 1; Rev* cl = NULL; const Rev* r = revLookup(ZERO_SHA);
@@ -870,7 +870,7 @@ int Git::addChunk(FileHistory* fh, constQByteArray& ba, int start) {
rev = new Rev(ba, start, fh->revOrder.count(), &nextStart,
!isMainHistory(fh));
if (nextStart == -2)
- doEarlyOutput(rev, &start);
+ doEarlyOutput(rev, ba, &start);
} while (nextStart == -2);
@@ -1377,8 +1377,8 @@ int Rev::indexData(bool quick, bool withDiff) const { if (start > last) // offset 'start' points to the char after "commit " return -1; - if (uint(ba.at(start) == 'u')) - return -2; // "Final output:", let caller handle this + if (uint(ba.at(start) == 'u')) // "Final output:", let caller handle this + return (ba.indexOf('\n', start) != -1 ? -2 : -1); // take in account --boundary and --left-right options startOfs = uint(ba.at(start) == '-' || ba.at(start) == '<' ||
ba.at(start) == '>'); -- 1.5.3.5.565.g985b6