Coder Social home page Coder Social logo

Cloning into bare git repo fails about subgit HOT 2 CLOSED

Grokzen avatar Grokzen commented on June 20, 2024
Cloning into bare git repo fails

from subgit.

Comments (2)

holmboe avatar holmboe commented on June 20, 2024
DEBUG: Repo update - all
Are you sure you want to update the following repos "myrepo"
(y/n) << y
Traceback (most recent call last):
  File "/home/nn/code/foobar/sgit/sgit/core.py", line 260, in update
    branch=revision['branch'],
  File "/home/nn/code/foobar/sgit/.venv/lib/python3.6/site-packages/git/repo/base.py", line 1017, in clone_from
    return cls._clone(git, url, to_path, GitCmdObjectDB, progress, multi_options, **kwargs)
  File "/home/nn/code/foobar/sgit/.venv/lib/python3.6/site-packages/git/repo/base.py", line 958, in _clone
    finalize_process(proc, stderr=stderr)
  File "/home/nn/code/foobar/sgit/.venv/lib/python3.6/site-packages/git/util.py", line 328, in finalize_process
    proc.wait(**kwargs)
  File "/home/nn/code/foobar/sgit/.venv/lib/python3.6/site-packages/git/cmd.py", line 408, in wait
    raise GitCommandError(self.args, status, errstr)
git.exc.GitCommandError: Cmd('git') failed due to: exit code(128)
  cmdline: git clone --branch=master -v [email protected]:foobar/myrepo.git /home/nn/code/foobar/sysrepo/myrepo
  stderr: 'Cloning into '/home/nn/code/foobar/sysrepo/myrepo'...
fatal: Remote branch master not found in upstream origin
fatal: the remote end hung up unexpectedly
'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/nn/code/foobar/sgit/sgit/cli.py", line 185, in cli_entrypoint
    exit_code = run(cli_args, sub_args)
  File "/home/nn/code/foobar/sgit/sgit/cli.py", line 171, in run
    retcode = core.update(repo)
  File "/home/nn/code/foobar/sgit/sgit/core.py", line 264, in update
    raise SgitException(f'Clone "{name}" failed, exception: {e}')
sgit.exceptions.SgitException: Clone "myrepo" failed, exception: Cmd('git') failed due to: exit code(128)
  cmdline: git clone --branch=master -v [email protected]:foobar/myrepo.git /home/nn/code/foobar/sysrepo/myrepo
  stderr: 'Cloning into '/home/nn/code/foobar/sysrepo/myrepo'...
fatal: Remote branch master not found in upstream origin
fatal: the remote end hung up unexpectedly
'
> /home/nn/code/foobar/sgit/sgit/core.py(264)update()
-> raise SgitException(f'Clone "{name}" failed, exception: {e}')

from subgit.

Grokzen avatar Grokzen commented on June 20, 2024

With the following .sgit.yml file

repos:
  bare:
    clone-url: [email protected]:dynamist/sgit-bare-repo.git
    revision:
      branch: master

you will get the following output from the initial update and future updates

(sgit) ➜  sgit git:(master) ✗ DEBUG=1 PDB=1 sgit -y update
DEBUG: Repo update - None
Are you sure you want to update the following repos "bare"
INFO: Automatically answer yes to question
Successfully cloned into bare git repo "bare" from remote server

(sgit) ➜  sgit git:(master) ✗ sgit update
DEBUG: Repo update - None
Are you sure you want to update the following repos "bare"
(y/n) << y
TODO: Parse for any changes...
DEBUG: Handling branch update case
Exception type : BadName
EXCEPTION MESSAGE: Ref 'origin/master' did not resolve to an object
To get more detailed exception set environment variable 'DEBUG=1'
To PDB debug set environment variable 'PDB=1'

Note that it is intended for the second sgit update to fail as the remote branch origin/master do not yet exists in a bare git repo.

from subgit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.