<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def merge(self, ref_name: str):
 """ Merges two refs Args: ref_name: ref to merge in the current one """

        if self.is_dirty():
            LOGGER.error('repository is dirty; cannot merge: %s', ref_name)
            sys.exit(-1)
        LOGGER.info('merging ref: "%s" into branch: %s', ref_name, self.get_current_branch())
        self.repo.git.merge(ref_name)