1
0
mirror of https://github.com/minio/mc.git synced 2025-11-10 13:42:32 +03:00

Remove isURLPrefixExists() call (#4173)

isURLPrefixExists() is used after url2Stat() function to check if the
given aliased URL corresponds to an existing prefix in the server. However,
 url2Stat() is already doing that and returns valid information for
those prefixes.

Removing isURLPrefixExists() all together.
This commit is contained in:
Anis Elleuch
2022-07-29 18:43:20 +01:00
committed by GitHub
parent 3d2dea913f
commit 624e3c1606
6 changed files with 8 additions and 30 deletions

View File

@@ -183,15 +183,7 @@ func checkCopySyntaxTypeC(ctx context.Context, srcURLs []string, tgtURL string,
for _, srcURL := range srcURLs {
c, srcContent, err := url2Stat(ctx, srcURL, "", false, keys, timeRef, isZip)
// incomplete uploads are not necessary for copy operation, no need to verify for them.
isIncomplete := false
if err != nil {
if !isURLPrefixExists(srcURL, isIncomplete) {
fatalIf(err.Trace(srcURL), "Unable to stat source `"+srcURL+"`.")
}
// No more check here, continue to the next source url
continue
}
fatalIf(err.Trace(srcURL), "Unable to stat source `"+srcURL+"`.")
if srcContent.Type.IsDir() {
// Require --recursive flag if we are copying a directory