I'm using gitpython on celery to clone public repositories and manipulate them. If a user specifies a private repository, it blocks the program whilst waiting for input from the screen where celery runs.
-------------- celery@rubenPC v4.0.2 (latentcall)
---- **** -----
--- * *** * --
-- * - **** ---
- ** ---------- [config]
- ** ---------- .> app: app:0x7f31d3e7afd0
- ** ---------- .> transport: redis://localhost:6379//
- ** ---------- .> results: redis://localhost:6379/
- *** --- * --- .> concurrency: 4 (prefork)
-- ******* ---- .> task events: OFF (enable -E to monitor tasks in this worker)
--- ***** -----
-------------- [queues]
.> celery exchange=celery(direct) key=celery
Repo URL: http://example.com/user/privaterepo
Username for 'https://gitlab.com':
This causes the worker to be unusable, and never exit the job. kill_after_timeout
doesn't make a difference.
Here is my code:
print("Repo URL: " + urlstr)
repo = git.Repo.clone_from(urlstr, gitDir, \
progress=None, env=None, depth=1, recursive=True, kill_after_timeout=15)
I've tried hanging to git://. This causes the client to be stuck on Cloning into dir
forever - I can reproduce this just using git clone git://URL
. kill_after_timeout
doesn't make a difference.
The following command works on pure CLI:
git clone -c credential.helper='!f() { cat > /dev/null; echo username=; echo password=; }; f' http://example.com/user/privaterepo
However I can't work out how to specify the above using GitPython.
print("Repo URL: " + urlstr)
repo = git.Repo.clone_from(urlstr, gitDir, \
c="credential.helper='!f() { cat > /dev/null; echo username=; echo password=; }; f'", \
progress=None, env=None, depth=1, recursive=True, kill_after_timeout=15)