@property
    def created(self):
        # XXX: last_modified と似ているので、うまくまとめる
        created = None
        visited = set()
        pendings = [self.commit]
        abs_name = self.abs_name
        while pendings:
            commit = pendings.pop(0)
            visited.add(commit.sha)

            for parent_commit in commit.parents:
                if parent_commit in visited:
                    continue

                if abs_name in parent_commit.tree:
                    pendings.append(parent_commit)

                else:
                    commit_time = parent_commit.commit_time
                    if created is None or commit_time < created:
                        created = commit_time

            else:
                # no parents -> initial commit
                created = commit.commit_time

        return created
dataset/ETHPy150Open nakamuray/blikit/blikit/models.py/BaseObject.created/original