def get_info_refs(self):
        service_name = self.get_service_type()
        if self.has_access(service_name):
            git_cmd = "upload_pack" if service_name == "upload-pack" else "receive_pack"
            refs = getattr(self.git, git_cmd)(self.dir, {"advertise_refs": True})
            self.status = "200"
            self.headers["Content-Type"] = "application/x-git-%s-advertisement" % service_name
            self.hdr_nocache()
            def read_file():
                yield self.pkt_write("# service=git-%s\n" % service_name)
                yield self.pkt_flush
                yield refs
            return read_file()
        else:
            return self.dumb_info_refs()
dataset/ETHPy150Open douban/gpack/ghttp.py/GHTTPServer.get_info_refs/original