Skip to content

Doesn't Handle Submodules #424

Closed
Closed
@rpocklington

Description

@rpocklington

Subject of the issue

The project doesn't appear to handle repositories loaded as submodules.

Your environment

  • git version 2.17.2 (Apple Git-113)
  • Gem: git (1.5.0)
  • ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin18]

Steps to reproduce

  1. Create a repository foo
  2. Create another repository bar
  3. Add bar as a submodule to foo
  4. Call g = Git.open("foo/bar")
  5. Call g.config

Expected behaviour

g.config returns a hash of configuration properties for the bar repository.

Actual behaviour

Errno::ENOTDIR (Not a directory @ dir_chdir - /Users/someuser/projects/foo/bar/.git)

Full output:

[someuser: ~/projects/foo (master)]$ irb
2.5.1 :001 > require 'git'
 => true
2.5.1 :002 > g = Git.open("bar")
 => #<Git::Base:0x00007fdf64880fe0 @logger=nil, @working_directory=#<Git::WorkingDirectory:0x00007fdf64880cc0 @path="/Users/someuser/projects/foo/bar">, @repository=#<Git::Repository:0x00007fdf64880b30 @path="/Users/someuser/projects/foo/bar/.git">, @index=#<Git::Index:0x00007fdf64880950 @path="/Users/someuser/projects/foo/bar/.git/index">>
2.5.1 :003 > g.config
Traceback (most recent call last):
        5: from /Users/someuser/.rvm/rubies/ruby-2.5.1/bin/irb:11:in `<main>'
        4: from (irb):3
        3: from /Users/someuser/.rvm/gems/ruby-2.5.1/gems/git-1.5.0/lib/git/base.rb:123:in `config'
        2: from /Users/someuser/.rvm/gems/ruby-2.5.1/gems/git-1.5.0/lib/git/lib.rb:465:in `config_list'
        1: from /Users/someuser/.rvm/gems/ruby-2.5.1/gems/git-1.5.0/lib/git/lib.rb:465:in `chdir'
Errno::ENOTDIR (Not a directory @ dir_chdir - /Users/someuser/projects/foo/bar/.git)
2.5.1 :004 > exit

[someuser: ~/projects/foo (master)]$ cat bar/.git
gitdir: ../.git/modules/dashboards

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions