MinGW: Add symlink support for NTFS on windows
commit82cc187b952b8d6539bcb72ea5c63469409c919a
authorMichael Geddes <michael@frog.wheelycreek.net>
Wed, 14 May 2014 05:59:48 +0000 (14 13:59 +0800)
committerMichael Geddes <michael@frog.wheelycreek.net>
Sat, 21 Jun 2014 00:43:40 +0000 (21 08:43 +0800)
tree5be696be706d087995cb22d32379194e853c346d
parent7e872d24a9bd039f9ffa24e8b3e4ec6b9fa9ead4
MinGW: Add symlink support for NTFS on windows

This patch implements git support for NTFS symbolic link type reparse points.

* There is a specific privelege required to create symbolic links that is not
  generally associated with a standard user. This part is up to the user to worry
  about.

* NTFS reparse points differentiate between file and directory links.  This
  patch assumes file links are meant. (A separate patch will develop this
  further).

* This patch is not intended to implement symbolic links in the shell utilities.
  This means that as of when this was written, bash and gnu utilities do not
  handle them.

* Windows chdir behaves differently to *nix, and we need to unravel symbolic
  links for various operations to work as expected.

* For efficiency, as much as possible of the calls are done with wchar_t, before
  being converted to utf-8.  This is as much about avoiding dealing with windows
  default encoding as anything else.

* resolve_symlink needed to be replaced in lockfile.c since there are some
  issues with recognising absolute paths, as well as for efficiency with
  wchar_t.

This work was based on a combination of patches developed by the following
people:

original-by: Johannes Schindelin <johannes.schindelin@gmx.de>
original-by: Thorvald Natvig <slicer@users.sourceforge.net>

Signed-off-by: Michael Geddes <michael@frog.wheelycreek.net>
compat/mingw.c
compat/mingw.h
compat/win32/dirent.c
lockfile.c