diff --git a/go.mod b/go.mod index 1fd95dee40d..f0b97ccc1c4 100644 --- a/go.mod +++ b/go.mod @@ -31,7 +31,7 @@ require ( github.com/ipfs/go-graphsync v0.11.0 github.com/ipfs/go-ipfs-blockstore v1.2.0 github.com/ipfs/go-ipfs-chunker v0.0.5 - github.com/ipfs/go-ipfs-cmds v0.7.0 + github.com/ipfs/go-ipfs-cmds v0.8.0 github.com/ipfs/go-ipfs-exchange-interface v0.1.0 github.com/ipfs/go-ipfs-exchange-offline v0.2.0 github.com/ipfs/go-ipfs-files v0.0.9 diff --git a/go.sum b/go.sum index 43f65b68404..496708baef5 100644 --- a/go.sum +++ b/go.sum @@ -473,8 +473,8 @@ github.com/ipfs/go-ipfs-blocksutil v0.0.1/go.mod h1:Yq4M86uIOmxmGPUHv/uI7uKqZNtL github.com/ipfs/go-ipfs-chunker v0.0.1/go.mod h1:tWewYK0we3+rMbOh7pPFGDyypCtvGcBFymgY4rSDLAw= github.com/ipfs/go-ipfs-chunker v0.0.5 h1:ojCf7HV/m+uS2vhUGWcogIIxiO5ubl5O57Q7NapWLY8= github.com/ipfs/go-ipfs-chunker v0.0.5/go.mod h1:jhgdF8vxRHycr00k13FM8Y0E+6BoalYeobXmUyTreP8= -github.com/ipfs/go-ipfs-cmds v0.7.0 h1:0lEldmB7C83RxIOer38Sv1ob6wIoCAIEOaxiYgcv7wA= -github.com/ipfs/go-ipfs-cmds v0.7.0/go.mod h1:y0bflH6m4g6ary4HniYt98UqbrVnRxmRarzeMdLIUn0= +github.com/ipfs/go-ipfs-cmds v0.8.0 h1:M7apkPxhGe7I3rcKuQ8xRJLIPdaEqaZhJz0uPZEE8EU= +github.com/ipfs/go-ipfs-cmds v0.8.0/go.mod h1:y0bflH6m4g6ary4HniYt98UqbrVnRxmRarzeMdLIUn0= github.com/ipfs/go-ipfs-delay v0.0.0-20181109222059-70721b86a9a8/go.mod h1:8SP1YXK1M1kXuc4KJZINY3TQQ03J2rwBG9QfXmbRPrw= github.com/ipfs/go-ipfs-delay v0.0.1 h1:r/UXYyRcddO6thwOnhiznIAiSvxMECGgtv35Xs1IeRQ= github.com/ipfs/go-ipfs-delay v0.0.1/go.mod h1:8SP1YXK1M1kXuc4KJZINY3TQQ03J2rwBG9QfXmbRPrw= diff --git a/test/sharness/t0040-add-and-cat.sh b/test/sharness/t0040-add-and-cat.sh index 635b97453a9..36a6e224050 100755 --- a/test/sharness/t0040-add-and-cat.sh +++ b/test/sharness/t0040-add-and-cat.sh @@ -345,6 +345,27 @@ test_add_cat_file() { echo "added Qmf35k66MZNW2GijohUmXQEWKZU4cCGTCwK6idfnt152wJ hello2.txt" >> expected && test_cmp expected actual ' + + test_expect_success "ipfs add with multiple files of same name succeeds" ' + mkdir -p mountdir/same-file/ && + cp mountdir/hello.txt mountdir/same-file/hello.txt && + ipfs add mountdir/hello.txt mountdir/same-file/hello.txt >actual && + rm mountdir/same-file/hello.txt && + rmdir mountdir/same-file + ' + + test_expect_success "ipfs add with multiple files of same name output looks good" ' + echo "added QmVr26fY1tKyspEJBniVhqxQeEjhF78XerGiqWAwraVLQH hello.txt" >expected && + test_cmp expected actual + ' + + test_must_fail "ipfs add with multiple files of same name but different dirs fails" ' + mkdir -p mountdir/same-file/ && + cp mountdir/hello.txt mountdir/same-file/hello.txt && + ipfs add mountdir/hello.txt mountdir/same-file/hello.txt >actual && + rm mountdir/same-file/hello.txt && + rmdir mountdir/same-file + ' } test_add_cat_5MB() {