Fix possible NPE in DirCacheCheckout
There was a chance that we hit a NPE which doing a checkout with DirCacheCheckout when there is no HEAD (e.g. initial checkout). This is fixed here. Change-Id: Ie3b8cae21dcd90ba8352823ea94a700f8ee9221a Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
This commit is contained in:
parent
9b4876cedf
commit
609c6dc358
|
@ -280,10 +280,13 @@ void processEntry(CanonicalTreeParser m, DirCacheBuildIterator i,
|
|||
if (walk.isDirectoryFileConflict()) {
|
||||
conflicts.add(walk.getPathString());
|
||||
} else {
|
||||
// ... and the working dir contained a file or folder ->
|
||||
// add it to the removed set and remove it from conflicts set
|
||||
remove(i.getEntryPathString());
|
||||
conflicts.remove(i.getEntryPathString());
|
||||
if (i != null) {
|
||||
// ... and the working dir contained a file or folder ->
|
||||
// add it to the removed set and remove it from
|
||||
// conflicts set
|
||||
remove(i.getEntryPathString());
|
||||
conflicts.remove(i.getEntryPathString());
|
||||
}
|
||||
}
|
||||
} else
|
||||
keep(i.getDirCacheEntry());
|
||||
|
|
Loading…
Reference in New Issue