mirror of
https://github.com/Murmele/Gittyup.git
synced 2024-09-11 10:45:39 +03:00
check staged only if hunkLineStart is valid. If not valid it means, the file was newly added
This commit is contained in:
parent
f973acbbfb
commit
3dbf5e65b1
@ -735,10 +735,9 @@ void HunkWidget::load(git::Patch &staged, bool force)
|
||||
int stagedIndex = -1;
|
||||
QByteArray header = mPatch.header(mIndex);
|
||||
int hunkLineStart = mPatch.lineNumber(mIndex, 0, git::Diff::OldFile);
|
||||
assert(hunkLineStart >= 0);
|
||||
// TODO: handle conflicted patch.
|
||||
// There must exist a staged patch for it
|
||||
if (mStaged.isValid() && !mPatch.isConflicted()) {
|
||||
if (hunkLineStart >= 0 && mStaged.isValid() && !mPatch.isConflicted()) {
|
||||
for (int i = 0; i < mStaged.count(); i++) {
|
||||
int hunkStagedLineStart = mStaged.lineNumber(i, 0, git::Diff::OldFile);
|
||||
assert(hunkStagedLineStart >= 0);
|
||||
|
Loading…
Reference in New Issue
Block a user