private void collectDiffChanges() throws VcsException {
  Collection<FilePath> dirtyPaths=dirtyPaths(true);
  if (dirtyPaths.isEmpty()) {
    return;
  }
  try {
    String output=GitChangeUtils.getDiffOutput(myProject,myVcsRoot,"HEAD",dirtyPaths);
    GitChangeUtils.parseChanges(myProject,myVcsRoot,null,GitChangeUtils.resolveReference(myProject,myVcsRoot,"HEAD"),output,myChanges,myUnmergedNames);
  }
 catch (  VcsException ex) {
    if (!GitChangeUtils.isHeadMissing(ex)) {
      throw ex;
    }
    GitSimpleHandler handler=new GitSimpleHandler(myProject,myVcsRoot,GitCommand.LS_FILES);
    handler.addParameters("--cached");
    handler.setSilent(true);
    handler.setStdoutSuppressed(true);
    String output=handler.run();
    if (output.length() > 0) {
      StringTokenizer tokenizer=new StringTokenizer(output,"\n\r");
      while (tokenizer.hasMoreTokens()) {
        final String s=tokenizer.nextToken();
        Change ch=new Change(null,GitContentRevision.createRevision(myVcsRoot,s,null,myProject,false,false,true),FileStatus.ADDED);
        myChanges.add(ch);
      }
    }
  }
}

private void collectDiffChanges ( ) throws VcsException { Collection < FilePath > dirtyPaths = dirtyPaths ( true ) ; if ( dirtyPaths . isEmpty ( ) ) { return ; } try { String output = GitChangeUtils . getDiffOutput ( myProject , myVcsRoot , "HEAD" , dirtyPaths ) ; GitChangeUtils . parseChanges ( myProject , myVcsRoot , null , GitChangeUtils . resolveReference ( myProject , myVcsRoot , "HEAD" ) , output , myChanges , myUnmergedNames ) ; } catch ( VcsException ex ) { if ( ! GitChangeUtils . isHeadMissing ( ex ) ) { throw ex ; } GitSimpleHandler handler = new GitSimpleHandler ( myProject , myVcsRoot , GitCommand . LS_FILES ) ; handler . addParameters ( "--cached" ) ; handler . setSilent ( true ) ; handler . setStdoutSuppressed ( true ) ; String output = handler . run ( ) ; if ( output . length ( ) > 0 ) { StringTokenizer tokenizer = new StringTokenizer ( output , "\n\r" ) ; while ( tokenizer . hasMoreTokens ( ) ) { final String s = tokenizer . nextToken ( ) ; Change ch = new Change ( null , GitContentRevision . createRevision ( myVcsRoot , s , null , myProject , false , false , true ) , FileStatus . ADDED ) ; myChanges . add ( ch ) ; } } } }
collect diff with head
