Skip to content

subgit created repo causes GitPython to assert #480

Closed
@barry-scott

Description

@barry-scott

I get this assert:

File "/home/barry/wc/git/scm-workbench/Source/Git/wb_git_project.py", line 217, in canPush
for ref in remote.refs:
File "/home/barry/wc/git/scm-workbench/Source/Git/git/remote.py", line 463, in refs
assert out_refs, "Remote %s did not have any references" % self.name
AssertionError: Remote origin did not have any references

But git remote -v is happy:

$ git remote -v
origin https://github.com/barry-scott/BarrysEmacs.git (fetch)
origin https://github.com/barry-scott/BarrysEmacs.git (push)

It seems that subgit used the .git/.config file to setup the remote. Here is the .git/config

cat config 
[core]
        repositoryformatversion = 0
        filemode = true
        bare = false
        logallrefupdates = true
        autocrlf = false
        eol = lf
        symlinks = true
[remote "origin"]
        url = https://github.com/barry-scott/BarrysEmacs.git
        fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
        remote = origin
        merge = refs/heads/master
[gc]
        autodetach = false
        auto = 0

It seems that GitPython should be looking in config as well to find remote info but is not.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions