javagit/src/main/java/edu/nyu/cs/javagit/api/GitFileSystemObject.java
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;
    }
  }
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;
    }
  }
Gets parent directory of this <code>GitFileSystemObject</code> object

@return parent directory (null if invalid)