varunsridharan / github-gitea-mirror

Simple Python Script To Mirror Repository From Github To Gitea
MIT License
182 stars 22 forks source link

Fixed identation on repositorySource.py #10

Closed marschr closed 1 year ago

marschr commented 1 year ago

Hi,

I fixed an identation issue on repositorySource.py that was spamming the terminal with ---> Warning : Repository Already Exists because the m variable on line 38 never goes out of scope after the if statement finishes in python.

Once the pygithub API repo iterable return a false repo.fork on line 16 (i.e. it's a source repo, not a fork) this given repo is assigned to the m variable and never goes out of scope, even on subsequent iterations where the if statement on line 16 returns repo.fork as true (skipping the if block) leaving the m variable assigned to the last iteration value, causing giteaCreateRepo() to spam the warning message.

So far fixing identation here fixed my bugs, currenly I'm trying to sync a few dozen of repos and keeping an eye on the resuls, I may be wrong and overseeing something, feel free to correct me and discard this PR.

varunsridharan commented 1 year ago

Hi

Thanks for your pull request.

i would like to inform you that if you run the script more than 1 times and if a repository already exists in Gitea then it will throw ---> Warning : Repository Already Exists

Could you please share your screenshot so i can check if throwing a lot of errors like that ?

varunsridharan commented 1 year ago

this how it should look image

But sometimes few more lines of the same content will be added which could look like below image

seowalex commented 1 year ago

This seems like a bug in the indentation. I am facing UnboundLocalError: local variable 'm' referenced before assignment because the variable m is not defined if the first repo is not a fork.