dynamist / subgit

Sub-git repo handler
Apache License 2.0
0 stars 0 forks source link

Reference at 'refs/heads/master' does already exist #11

Closed holmboe closed 2 years ago

holmboe commented 4 years ago
$ mkdir tmp
$ sgit init
$ sgit repo add tmp/foobar git@gitlab.com:dynamist/foobar.git master
$ sgit update
DEBUG: Repo update - all
Are you sure you want to update the following repos "foo, bar, baz, tmp/foobar"
(y/n) << y
TODO: Parse for any changes...
DEBUG: Handling branch update case
Traceback (most recent call last):
  File "/home/nn/code/sgit/sgit/cli.py", line 186, in cli_entrypoint
    exit_code = run(cli_args, sub_args)
  File "/home/nn/code/sgit/sgit/cli.py", line 172, in run
    retcode = core.update(repo)
  File "/home/nn/code/sgit/sgit/core.py", line 319, in update
    repo.create_head(f'{branch_revision}', f'origin/{branch_revision}')
  File "/home/nn/code/sgit/.venv/lib/python3.6/site-packages/git/repo/base.py", line 386, in create_head
    return Head.create(self, path, commit, force, logmsg)
  File "/home/nn/code/sgit/.venv/lib/python3.6/site-packages/git/refs/symbolic.py", line 543, in create
    return cls._create(repo, path, cls._resolve_ref_on_create, reference, force, logmsg)
  File "/home/nn/code/sgit/.venv/lib/python3.6/site-packages/git/refs/symbolic.py", line 506, in _create
    (full_ref_path, existing_data, target_data))
OSError: Reference at 'refs/heads/master' does already exist, pointing to '631771e9b527cb8b1ef92735b936744270f363ee', requested was '4a29994ad13964de9f869b82873482cdcf03b894'
> /home/nn/code/sgit/.venv/lib/python3.6/site-packages/git/refs/symbolic.py(506)_create()
-> (full_ref_path, existing_data, target_data))
Grokzen commented 2 years ago

@holmboe I tested the steps to reproduce you provided and all i get on my side is "unable to clone repo, repo not found error" which i expect. What i see tho is that you have several other repos, foo, bar, baz already present and active that probably is the root cause and not this adding of a new repo itself. There needs to be some other reproducible steps provided in order to track down this error.