Skip to content

demands creating the lock file when I need just to get a list of submodules #569

Open
@yarikoptic

Description

@yarikoptic

which obviously fails if I have no write access to that repository. Here it is invoked from within datalad (trimmed the backtrace to the point where we access GitPython's Repo in self.repo)

  File "/home/yoh/proj/datalad/datalad/datalad/support/gitrepo.py", line 1543, in get_submodules
    submodules = self.repo.submodules
  File "/home/yoh/proj/datalad/datalad/venv/dev-gitpython/local/lib/python2.7/site-packages/git/repo/base.py", line 276, in submodules
    return Submodule.list_items(self)
  File "/home/yoh/proj/datalad/datalad/venv/dev-gitpython/local/lib/python2.7/site-packages/git/util.py", line 932, in list_items
    out_list.extend(cls.iter_items(repo, *args, **kwargs))
  File "/home/yoh/proj/datalad/datalad/venv/dev-gitpython/local/lib/python2.7/site-packages/git/objects/submodule/base.py", line 1185, in iter_items
    entry = index.entries[index.entry_key(p, 0)]
  File "/home/yoh/proj/datalad/datalad/venv/dev-gitpython/local/lib/python2.7/site-packages/gitdb/util.py", line 237, in __getattr__
    self._set_cache_(attr)
  File "/home/yoh/proj/datalad/datalad/venv/dev-gitpython/local/lib/python2.7/site-packages/git/index/base.py", line 120, in _set_cache_
    fd = lfd.open(write=False, stream=False)
  File "/home/yoh/proj/datalad/datalad/venv/dev-gitpython/local/lib/python2.7/site-packages/gitdb/util.py", line 314, in open
    raise IOError("Lock at %r could not be obtained" % self._lockfilepath())
IOError: Lock at '/tmp/physionet/.git/index.lock' could not be obtained
()
> /home/yoh/proj/datalad/datalad/venv/dev-gitpython/local/lib/python2.7/site-packages/gitdb/util.py(314)open()
-> raise IOError("Lock at %r could not be obtained" % self._lockfilepath())
(Pdb) import git
(Pdb) git.__version__
'2.1.1'

FWIW regular 'git submodule' command works fine.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions