Re: [PATCH v2 00/11] git worktree (re)move

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Am 29.11.2016 um 14:56 schrieb Duy Nguyen:
If you drop all the "copy.c: " patches and squash this to "worktree
move: new command", and if Windows rename() can move directories, then
git should build and new tests pass.

Thanks! rename() can move directories on Windows, provided that *nothing* inside the directory is in any form of use by any process, particularly also not as the "current working directory" (as per getcwd()).

diff --git a/copy.c b/copy.c
index 4de6a11..b232aec 100644
--- a/copy.c
+++ b/copy.c
@@ -65,3 +65,9 @@ int copy_file_with_time(const char *dst, const char *src, int mode)
 		return copy_times(dst, src);
 	return status;
 }
+
+int copy_dir_recursively(const char *dst, const char *src)
+{
+	errno = ENOSYS;
+	return -1;
+}

An error message "cannot move directories across devices" or something would be preferable over "Function not implemented", of course. Or did you mean to set errno = EXDEV?

-- Hannes




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]