private void resort() { Arrays.sort(entries, 0, entryCnt, DirCache.ENT_CMP); for (int entryIdx = 1; entryIdx < entryCnt; entryIdx++) { final DirCacheEntry pe = entries[entryIdx - 1]; final DirCacheEntry ce = entries[entryIdx]; final int cr = DirCache.cmp(pe, ce); if (cr == 0) { // Same file path; we can only allow this if the stages // are 1-3 and no 0 exists. // final int peStage = pe.getStage(); final int ceStage = ce.getStage(); if (peStage == ceStage) throw bad(ce, JGitText.get().duplicateStagesNotAllowed); if (peStage == 0 || ceStage == 0) throw bad(ce, JGitText.get().mixedStagesNotAllowed); } } sorted = true; }
private void beforeAdd(DirCacheEntry newEntry) { if (sorted && entryCnt > 0) { final DirCacheEntry lastEntry = entries[entryCnt - 1]; final int cr = DirCache.cmp(lastEntry, newEntry); if (cr > 0) { // The new entry sorts before the old entry; we are // no longer sorted correctly. We'll need to redo // the sorting before we can close out the build. // sorted = false; } else if (cr == 0) { // Same file path; we can only insert this if the // stages won't be violated. // final int peStage = lastEntry.getStage(); final int dceStage = newEntry.getStage(); if (peStage == dceStage) throw bad(newEntry, JGitText.get().duplicateStagesNotAllowed); if (peStage == 0 || dceStage == 0) throw bad(newEntry, JGitText.get().mixedStagesNotAllowed); if (peStage > dceStage) sorted = false; } } }
private void resort() { Arrays.sort(entries, 0, entryCnt, DirCache.ENT_CMP); for (int entryIdx = 1; entryIdx < entryCnt; entryIdx++) { final DirCacheEntry pe = entries[entryIdx - 1]; final DirCacheEntry ce = entries[entryIdx]; final int cr = DirCache.cmp(pe, ce); if (cr == 0) { // Same file path; we can only allow this if the stages // are 1-3 and no 0 exists. // final int peStage = pe.getStage(); final int ceStage = ce.getStage(); if (peStage == ceStage) throw bad(ce, JGitText.get().duplicateStagesNotAllowed); if (peStage == 0 || ceStage == 0) throw bad(ce, JGitText.get().mixedStagesNotAllowed); } } sorted = true; }
private void resort() { Arrays.sort(entries, 0, entryCnt, DirCache.ENT_CMP); for (int entryIdx = 1; entryIdx < entryCnt; entryIdx++) { final DirCacheEntry pe = entries[entryIdx - 1]; final DirCacheEntry ce = entries[entryIdx]; final int cr = DirCache.cmp(pe, ce); if (cr == 0) { // Same file path; we can only allow this if the stages // are 1-3 and no 0 exists. // final int peStage = pe.getStage(); final int ceStage = ce.getStage(); if (peStage == ceStage) throw bad(ce, JGitText.get().duplicateStagesNotAllowed); if (peStage == 0 || ceStage == 0) throw bad(ce, JGitText.get().mixedStagesNotAllowed); } } sorted = true; }
private void beforeAdd(DirCacheEntry newEntry) { if (sorted && entryCnt > 0) { final DirCacheEntry lastEntry = entries[entryCnt - 1]; final int cr = DirCache.cmp(lastEntry, newEntry); if (cr > 0) { // The new entry sorts before the old entry; we are // no longer sorted correctly. We'll need to redo // the sorting before we can close out the build. // sorted = false; } else if (cr == 0) { // Same file path; we can only insert this if the // stages won't be violated. // final int peStage = lastEntry.getStage(); final int dceStage = newEntry.getStage(); if (peStage == dceStage) throw bad(newEntry, JGitText.get().duplicateStagesNotAllowed); if (peStage == 0 || dceStage == 0) throw bad(newEntry, JGitText.get().mixedStagesNotAllowed); if (peStage > dceStage) sorted = false; } } }
private void beforeAdd(final DirCacheEntry newEntry) { if (sorted && entryCnt > 0) { final DirCacheEntry lastEntry = entries[entryCnt - 1]; final int cr = DirCache.cmp(lastEntry, newEntry); if (cr > 0) { // The new entry sorts before the old entry; we are // no longer sorted correctly. We'll need to redo // the sorting before we can close out the build. // sorted = false; } else if (cr == 0) { // Same file path; we can only insert this if the // stages won't be violated. // final int peStage = lastEntry.getStage(); final int dceStage = newEntry.getStage(); if (peStage == dceStage) throw bad(newEntry, JGitText.get().duplicateStagesNotAllowed); if (peStage == 0 || dceStage == 0) throw bad(newEntry, JGitText.get().mixedStagesNotAllowed); if (peStage > dceStage) sorted = false; } } }