Skip to content

git-semver fails if launched from a subfoler of the repository #33

Closed
@yobeonline

Description

@yobeonline

Description

Git-semver fails when launched from a subdirectory, wherease git describe succeeds.

Steps to reproduce

mkdir -p test/foo
cd test
git init
touch foo/bar
git add foo/bar
git commit -m"init"
git tag -a 0.1.0 -m"release"
cd foo
git describe
# 0.1.0
git-semver
# failed to open repo: repository does not exist

Fix

I will PR later, but I think the problem lies here. According to this post, you should call git.PlainOpenWithOptions instead of git.PlainOpen. The option structure is declared here and should have the attribute DetectDotGit set to true.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions