Closed KyleKing closed 2 years ago
I also encountered this error when running git version 2.34.0
I would be happy to submit a PR if you would be open to changes for this
Sounds good to me! 👍
On Mon, Feb 7, 2022 at 8:11 PM Kyle King @.***> wrote:
I would be happy to submit a PR if you would be open to changes for this
— Reply to this email directly, view it on GitHub https://github.com/rscherf/GitLink/issues/26#issuecomment-1032139056, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABSKRHN64KCXNKHDHRH3BDU2B3ULANCNFSM5MLAJVSQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
You are receiving this because you are subscribed to this thread.Message ID: @.***>
On the latest version of GitLink, I see the below error
The issue is that my version of git is too old
2.20.1
(>2.22
)The error should have likely been caught at
git branch ...
, but it looks like neithererr
norout.returncode
are checked:https://github.com/rscherf/GitLink/blob/e2e7c412630246efc86de4fe71192f15bf11209e/GitLink.py#L38-L40
It may also be beneficial to validate the branch name:
https://github.com/rscherf/GitLink/blob/e2e7c412630246efc86de4fe71192f15bf11209e/GitLink.py#L51-L52
You could alternatively replace the
--show-current
command with:git symbolic-ref --short HEAD
which is backward compatible (not that it needs to be) and would work with submodulesFor me, switching to git managed by homebrew (
brew install git
) fixed the issue and GitLink now works, but there might be some minor changes that could better handle errors. I would be happy to submit a PR!Update: updated a few times for clarity!