Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
yobeonline opened this issue Jan 10, 2024 · 0 comments · Fixed by #34
Closed

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

yobeonline opened this issue Jan 10, 2024 · 0 comments · Fixed by #34

Comments

@yobeonline
Copy link
Contributor

yobeonline commented Jan 10, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant