def completeFilename(self, commit, text):
        """
        Complete a filename within the given commit.
        """
        # Don't use os.path.split() or dirname() here, since that performs
        # some canonicalization like stripping out extra slashes.  We need to
        # return matches that with the exact text specified.
        idx = text.rfind(os.path.sep)
        if idx < 0:
            dirname = ''
            basename = text
        else:
            dirname = text[:idx+1]
            basename = text[idx+1:]

        # Expand commit name aliases
        commit = self.review.expandCommitName(commit)
        matches = []
        try:
            tree_entries = self.repoCache.listTree(commit, dirname)
        except __HOLE__, ex:
            return []

        for entry in tree_entries:
            if entry.name.startswith(basename):
                matches.append(entry)

        # If there is only 1 match, and it is a blob, add a space
        # TODO: It would be nicer to honor user's inputrc settings
        if len(matches) == 1 and matches[0].type == git.OBJ_BLOB:
            return [dirname + matches[0].name + ' ']

        string_matches = []
        for entry in matches:
            full_match = dirname + entry.name
            if entry.type == git.OBJ_TREE:
                full_match += os.path.sep
            string_matches.append(full_match)

        return string_matches
dataset/ETHPy150Open facebookarchive/git-review/src/gitreview/review/cli_reviewer.py/CliReviewer.completeFilename