I am working in a project where I have to simulate a local git instance and being able to push files to remote repositories in Azure, GitLab, BitBucket.
Working in OSX, Python 3.8 and installed dulwich=0.2.50. I have been trying to replicate this example: https://github.com/jelmer/dulwich/blob/master/examples/memoryrepo.py
..............................................................................................................
local_repo = MemoryRepo()
local_repo.refs.set_symbolic_ref(b'HEAD', b'refs/heads/master')
print(local_repo.refs.as_dict())
porcelain.fetch(local_repo, sys.argv[1])
local_repo['refs/heads/master'] = local_repo['refs/remotes/origin/master']
..............................................................................................................
Issues:
set_symbolic_ref() seems not having effect, since printing refs in next line returns {}, if I try to print refs after FETCH, it is empty yet (fetch is returning remote refs if I print it). Last line here is giving a KeyError since no refs in local repo, similar lines in this example is failing for same reason.
b'HEAD' does not exist in local repo.
--
You received this message because you are subscribed to the Google Groups "dulwich-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dulwich-discu...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/dulwich-discuss/9f751130-d92b-481d-9fef-901dbdeb516en%40googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/dulwich-discuss/821c3291-1175-48c7-b44e-59dede73b200n%40googlegroups.com.
Thanks Jelmer,Based in your knowledge as creator, do you think I can accomplish my goals?Goals:1. being able to simulate a local git instance (trying to avoid cloning) and able to push files to repositories on Azure, AWS CodeCommit, GitLab and Bitbucket using porcelain methods.
2. being able to grab files from those repositories.
3. Creating branches, tags in those repositories, maybe through "dulwich.client".
4. Authenticate with those repositories using Oath, code shows basic authentication but I could authenticate to Azure using Personal Authentication Token.
To view this discussion on the web, visit https://groups.google.com/d/msgid/dulwich-discuss/88fb4c3b-2a6d-460b-9fa3-3f1b8a3cfafdn%40googlegroups.com.