import logging


def parse_logs_head(data: bytes) -> set[str]:
    """Retrieve object hashes from logs/HEAD file."""
    ret = set()
    lines = data.split(b"\n")
    for line in lines:
        fields = line.split(b" ")
        if len(fields) < 2:
            break
        for i in range(2):      #first two fields are commit hashes
            digest = fields[i].decode()
            if digest == "0000000000000000000000000000000000000000":
                continue
            ret.add(digest)
            logging.info(f"Commit {digest} found in logs/HEAD")
    return ret