File tree Expand file tree Collapse file tree 2 files changed +8
-10
lines changed
Expand file tree Collapse file tree 2 files changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -306,11 +306,10 @@ func (p *Plugin) isFileOnDisk(path string) bool {
306306 return err == nil && ! info .IsDir ()
307307}
308308
309- // isDirTarget determines if the target should be treated as a directory
310- // Returns true if target ends with / or has no file extension
309+ // isDirTarget determines if the target should be treated as a directory.
310+ // On GCS we only care about a literal '/' suffix.
311311func (p * Plugin ) isDirTarget (target string ) bool {
312- target = filepath .Clean (target )
313- return strings .HasSuffix (target , "/" ) || filepath .Ext (target ) == ""
312+ return strings .HasSuffix (target , "/" )
314313}
315314
316315// isAbsolutePath checks if a path is absolute on any platform (Unix or Windows)
Original file line number Diff line number Diff line change @@ -492,11 +492,11 @@ func TestTargetPathFix(t *testing.T) {
492492}
493493
494494func TestCrossPlatformPaths (t * testing.T ) {
495-
495+
496496 // Test that filepath.IsAbs is used correctly for different platforms
497497 tests := []struct {
498- name string
499- path string
498+ name string
499+ path string
500500 wantAbs bool
501501 }{
502502 {"Unix absolute" , "/home/user/file.txt" , true },
@@ -529,8 +529,8 @@ func TestHelperFunctions(t *testing.T) {
529529 t .Error ("path ending with slash should be directory" )
530530 }
531531
532- if ! plugin .isDirTarget ("uploads" ) {
533- t .Error ("path without extension should be directory " )
532+ if plugin .isDirTarget ("uploads" ) {
533+ t .Error ("path without slash should be file " )
534534 }
535535
536536 if plugin .isDirTarget ("file.zip" ) {
@@ -540,7 +540,6 @@ func TestHelperFunctions(t *testing.T) {
540540
541541// TestShouldIgnoreFile tests ignore pattern functionality
542542func TestShouldIgnoreFile (t * testing.T ) {
543- // ... (rest of the code remains the same)
544543 tests := []struct {
545544 name string
546545 ignorePattern string
You can’t perform that action at this time.
0 commit comments