From e74340b0001247681bf0fe43f73622e87b52ccae Mon Sep 17 00:00:00 2001 From: Edward Thomson Date: Wed, 14 Jan 2015 18:47:00 -0500 Subject: checkout: remove files before writing new ones On case insensitive filesystems, we may have files in the working directory that case fold to a name we want to write. Remove those files (by default) so that we will not end up with a filename that has the unexpected case. --- include/git2/checkout.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include/git2') diff --git a/include/git2/checkout.h b/include/git2/checkout.h index ffbb53fc5..8314c623d 100644 --- a/include/git2/checkout.h +++ b/include/git2/checkout.h @@ -104,6 +104,11 @@ GIT_BEGIN_DECL * overwritten. Normally, files that are ignored in the working directory * are not considered "precious" and may be overwritten if the checkout * target contains that file. + * + * - GIT_CHECKOUT_DONT_REMOVE_EXISTING prevents checkout from removing + * files or folders that fold to the same name on case insensitive + * filesystems. This can cause files to retain their existing names + * and write through existing symbolic links. */ typedef enum { GIT_CHECKOUT_NONE = 0, /**< default is a dry run, no actual updates */ @@ -158,6 +163,9 @@ typedef enum { /** Include common ancestor data in diff3 format files for conflicts */ GIT_CHECKOUT_CONFLICT_STYLE_DIFF3 = (1u << 21), + /** Don't overwrite existing files or folders */ + GIT_CHECKOUT_DONT_REMOVE_EXISTING = (1u << 22), + /** * THE FOLLOWING OPTIONS ARE NOT YET IMPLEMENTED */ -- cgit v1.2.1