Skip to content

Progression not functional once a single error / fatal line was encountered #1233

Description

@mxrch

To run the script properly, just create a creds.py file with a token variable, and a .tmp folder

importcredsfromgitimportRepo, RemoteProgressfrompathlibimportPathimportuuidusername="gitpython-developers"repo_name="GitPython"uuid=uuid.uuid4().hex[:20]
# ---------------classProgress(RemoteProgress):
defupdate(self, op_code, cur_count, max_count=None, message=''):
print(f"{op_code}{cur_count}{max_count}{message}")
repo_url=f'https://{creds.token}:x-oauth-basic@github.com/{username}/{repo_name}'repo_path=Path('.tmp') /Path(uuid)
print(f'Cloning the commits history of {repo_name}...')
err=Nonetry:
Repo.clone_from("https://github.com/gitpython-developers/GitPython", repo_path, progress=Progress(), multi_options=["--filter=tree:0"])
#Repo.clone_from(repo_url, repo_path, progress=Progress(), multi_options=["--filter=tree:0"])exceptExceptionaserror:
err=errorprint(err)

If you comment the 1st Repo.clone_from and uncomment the 2nd, the progress will not work anymore, even though the progress is showing up using the git binary.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions