代码之家  ›  专栏  ›  技术社区  ›  deepbrook

获取给定提交的下一个旧标记?

  •  1
  • deepbrook  · 技术社区  · 6 年前

    def next_older_tag(commit):
        repo = commit.repo
        for tag in repo.tags:
            if tag.commit.committed_datetime >= commit.committed_datetime:
                continue
            return tag
    

    在咨询了医生之后,我找不到更好的方法来解决这个问题-我说的对吗?这是可行的,但感觉应该有更好的方法来做到这一点。

    0 回复  |  直到 6 年前