yeah, see line 335:

 // check if entry refers to a tracked file
 boolean tracked = dcTree != null || hTree != null;
 if (!tracked)
       break;

-> if hTree == null && dcTree == null this is untracked and we break out of the loop. 

In order to make this clear here without reevaluating that dcTree isn't null if hTree is null we could add a comment:

 if (emptyCommit
    && ( (hTree == null /* && dcTree != null (see tracked check above) */ ) 
     || !hTree.idEqual(fTree) 
     || hTree.getEntryRawMode() != fTree.getEntryRawMode()))