code: public GitDirectory getParent() {
      // NOTE: file.getParentFile() returns null if there is no parent.
      if(file.getParentFile() == null) {
        return null;
      }
      
      try {
        return new GitDirectory(file.getParentFile(), workingTree);
      }
      catch(JavaGitException e) {
        //invalid git parent
        return null;
      }
    }
docs: Gets parent directory of this <code>GitFileSystemObject</code> object
  
  @return parent directory (null if invalid)