-
Notifications
You must be signed in to change notification settings - Fork 759
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: cutpath for ../ paths #2498
fix: cutpath for ../ paths #2498
Conversation
Signed-off-by: Alex Pana <8968914+acpana@users.noreply.github.com>
// .Cut call below to actually work with the absolute path | ||
// contained in the file var. | ||
cutPath := strings.TrimPrefix(originalPath, "/") | ||
cutPath = strings.TrimPrefix(cutPath, "./") | ||
for strings.HasPrefix(cutPath, "../") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'm not too concerned about an infinite loop here since specifying an arbitrarily large number of prev directories has to happen for that
Codecov ReportBase: 53.35% // Head: 53.38% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #2498 +/- ##
==========================================
+ Coverage 53.35% 53.38% +0.02%
==========================================
Files 116 116
Lines 10270 10272 +2
==========================================
+ Hits 5480 5484 +4
+ Misses 4370 4368 -2
Partials 420 420
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Signed-off-by: Alex Pana 8968914+acpana@users.noreply.github.com
I missed specifying the prev dir relatively in my original cut trick: #2443 and this was raised in #2495. Fixes #2495 .
The issue was the cut didn't work w paths prefixed w
../
. Added tests for that now.Also, if you want to see it in action now for these kinds of paths: