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

fix(repo parsing): considers cases where git repo has a trailing / #606

Merged
merged 2 commits into from
Sep 14, 2024
Merged

fix(repo parsing): considers cases where git repo has a trailing / #606

merged 2 commits into from
Sep 14, 2024

Conversation

Hashino
Copy link
Contributor

@Hashino Hashino commented Sep 13, 2024

Describe what this PR does / why we need it

the automatic repository finding (when none passed as args) wouldn't work when the return of git remote -v had a trailing '/'. this is reproducible by adding a trailing '/' when cloning a repository

parser would split the lines with '/' as a delimiter. the trailing '/' made the result be an array of length 4 which wasn't considered.

Does this pull request fix one issue?

Fixes #605

Describe how you did it

added condition for when the split segments has a length of 4.

Describe how to verify it

git clone https://github.com/pwntester/octo.nvim/ && cd octo.nvim && nvim -c 'Octo issue list'

Special notes for reviews

additional checking that segment[4] == nil could be added to ensure this change fixes only this edge case

the opposite approach could be made and use if #segments > 2 so it becomes the default behavior for more edge cases

the automatic repository finding (when none passed as args) wouldn't
work when the return of `git remote -v` had a trailing '/'

parser would split the lines with '/' as a delimiter. the trailing '/'
made the result be an array of length 4 which wasn't considered.
@Hashino Hashino requested a review from pwntester September 14, 2024 14:58
@pwntester
Copy link
Owner

Thanks @Hashino can you please fix the linting errors?

@Hashino Hashino requested a review from pwntester September 14, 2024 16:57
@pwntester pwntester merged commit 955f0fd into pwntester:master Sep 14, 2024
2 checks passed
@pwntester
Copy link
Owner

Thanks!

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

Successfully merging this pull request may close these issues.

bug: Cannot find repo when repository cloned with a trailing /
2 participants