From: Johannes Schindelin Date: Fri, 5 Aug 2016 14:41:12 +0000 (+0200) Subject: git mv: do not keep slash in `git mv dir non-existing-dir/` X-Git-Tag: v2.10.0-rc0~7^2 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/189d035e67b1f8cdbb1dbd388efd1b7434f34b04?hp=189d035e67b1f8cdbb1dbd388efd1b7434f34b04 git mv: do not keep slash in `git mv dir non-existing-dir/` When calling `rename("dir", "non-existing-dir/")` on Linux, it silently succeeds, stripping the trailing slash of the second argument. This is all good and dandy but this behavior disagrees with the specs at http://pubs.opengroup.org/onlinepubs/9699919799/functions/rename.html that state clearly regarding the 2nd parameter (called `new`): If the `new` argument does not resolve to an existing directory entry for a file of type directory and the `new` argument contains at least one non- character and ends with one or more trailing characters after all symbolic links have been processed, `rename()` shall fail. Of course, we would like `git mv dir non-existing-dir/` to succeed (and rename the directory "dir" to "non-existing-dir"). Let's be extra careful to remove the trailing slash in that case. This lets t7001-mv.sh pass in Bash on Windows. Signed-off-by: Johannes Schindelin Signed-off-by: Junio C Hamano ---