You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
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.
All reactions