def METHOD_NAME(self, set_name, check_name):
    if not self.data:
        print("You need to first start the bisection")
        return -1
    ref = self.cref.get_latest_commit()
    if self.data[check_name] == ref:
        print('Commit %s is already set as %s...' % (
            ref, check_name))
        return 1
    if ref not in self.data['refs']:
        print("%s is not a known commit." % ref)
        return -1
    print("Setting %s as %s commit" % (ref, set_name))
    self.data[set_name] = ref
    if self.data[set_name] and self.data[check_name]:
        x1 = self.data['refs'].index(self.data['good'])
        x2 = self.data['refs'].index(self.data['bad'])
        refs = self.data['refs'][x1:x2]
        if not refs:
            print("=========================="
                  "First bad commit is:\n%s"
                  "==========================" % self.data['message'][self.data['bad']])
            exit(0)
        ref = refs[int(len(refs) / 2)]
        if self.data['good'] == ref:
            print("\n==========================\n"
                  "First bad commit is:\n\n%s"
                  "==========================" % self.data['messages'][self.data['bad']])
            exit(0)
        return self.checkout(ref)
    return -1