Remove stale refs so that they are no longer seen as fileserver envs

def clean_stale_refs(self):
        '''
        Remove stale refs so that they are no longer seen as fileserver envs
        '''
        cleaned = []
        cmd_str = 'git remote prune origin'

        # Attempt to force all output to plain ascii english, which is what some parsing code
        # may expect.
        # According to stackoverflow (http://goo.gl/l74GC8), we are setting LANGUAGE as well
        # just to be sure.
        env = os.environ.copy()
        env[b"LANGUAGE"] = b"C"
        env[b"LC_ALL"] = b"C"

        cmd = subprocess.Popen(
            shlex.split(cmd_str),
            close_fds=not salt.utils.platform.is_windows(),
            cwd=os.path.dirname(self.gitdir),
            env=env,
            stdout=subprocess.PIPE,
            stderr=subprocess.STDOUT)
        output = cmd.communicate()[0]
        if six.PY3:
            output = output.decode(__salt_system_encoding__)
        if cmd.returncode != 0:
            log.warning(
                'Failed to prune stale branches for %s remote \'%s\'. '
                'Output from \'%s\' follows:\n%s',
                self.role, self.id, cmd_str, output
            )
        else:
            marker = ' * [pruned] '
            for line in salt.utils.itertools.split(output, '\n'):
                if line.startswith(marker):
                    cleaned.append(line[len(marker):].strip())
            if cleaned:
                log.debug(
                    '%s pruned the following stale refs: %s',
                    self.role, ', '.join(cleaned)
                )
        return cleaned