-
Notifications
You must be signed in to change notification settings - Fork 136
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
Issue 928 #934
base: develop
Are you sure you want to change the base?
Issue 928 #934
Conversation
Signed-off-by: Ernst von Oelsen <[email protected]>
Signed-off-by: Ernst von Oelsen <[email protected]>
f89f70a
to
2ed4e9b
Compare
@@ -47,6 +47,12 @@ func NewSortedFilesFromPaths(paths []string, opts SymlinkAllowOpts) ([]*File, er | |||
|
|||
relativePath := "" | |||
pathPieces := strings.Split(path, "=") | |||
if strings.HasPrefix(pathPieces[0], "http://") || strings.HasPrefix(pathPieces[0], "https://") { | |||
pathPieces = []string{path} | |||
} else if len(pathPieces) > 1 && (strings.HasPrefix(pathPieces[1], "http://") || strings.HasPrefix(pathPieces[1], "https://")) { |
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.
What is the scenario where this if statement is triggered?
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.
@joaopapereira this is a safetynet for the use case that the file's path is overwritten on the command line; cf. the case 2
part in L60.
Example: want to cover both scenarios of
path = "myOverwrittenPath=https://example.com?hello=world"
path = "https://example.com?hello=world"
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.
Sorry for dropping this out, do you mind adding some tests for this? just 1 or 2 basic tests I think it would be enough
targets resolution of #928.