snakebite icon indicating copy to clipboard operation
snakebite copied to clipboard

mv moves globs to the wrong location when a directory already exists

Open daveFNbuck opened this issue 8 years ago • 0 comments

Script to trigger this:

snakebite rm -R '/tmp/test*'
snakebite mkdir /tmp/test
snakebite mkdir /tmp/test/a
snakebite mkdir /tmp/test_trash
snakebite mkdir /tmp/test_trash/a
snakebite mkdir /tmp/test_trash/a/b
snakebite mv /tmp/test_trash/* /tmp/test
snakebite ls /tmp/test
snakebite ls /tmp/test/a

This fails to move /tmp/test_trash/a to /tmp/test because /tmp/test/aalready exists. Weirdly, it then goes on to successfully move/tmp/test_trash/a/b to /tmp/test/b. If we don't make the /tmp/test/a directory, this works as expected, creating /tmp/test/a/b.

daveFNbuck avatar Oct 16 '17 20:10 daveFNbuck