def METHOD_NAME(dir: str):
    git_result = subprocess.run("git branch -r --contains HEAD".split(), capture_output=True, cwd=dir)
    branches = git_result.stdout.decode("utf-8").splitlines()
    for branch in branches:
        branch = branch.split()[-1].strip()
        if "couchbase" in branch:
            return branch[branch.find('/') + 1:]
    return "(unknown)"