text: public static FilePath Resolve(FilePath directory, FS fs){if (IsGitRepository(directory, fs)){return directory;}if (IsGitRepository(new FilePath(directory, Constants.DOT_GIT), fs)){return new FilePath(directory, Constants.DOT_GIT);}string name = directory.GetName();FilePath parent = directory.GetParentFile();if (IsGitRepository(new FilePath(parent, name + Constants.DOT_GIT_EXT), fs)){return new FilePath(parent, name + Constants.DOT_GIT_EXT);}return null;}