summaryrefslogtreecommitdiff
path: root/symlinks.c
diff options
context:
space:
mode:
authorClemens Buchacher <drizzd@aon.at>2011-02-20 13:13:43 +0100
committerJunio C Hamano <gitster@pobox.com>2011-02-21 22:51:07 -0800
commit1d718a5108f905e3c64f9fa791e67a52bd926457 (patch)
tree9871ac56854e4a1e983e390cd2c9f3a24beb0921 /symlinks.c
parent2fe26b775cfa298a0b4bc3c53011ca6da7c6c298 (diff)
downloadgit-1d718a5108f905e3c64f9fa791e67a52bd926457.tar.gz
do not overwrite untracked symlinks
Git traditionally overwrites untracked symlinks silently. This will generally not cause massive data loss, but it is inconsistent with the behavior for regular files, which are not silently overwritten. With this change, git refuses to overwrite untracked symlinks by default. If the user really wants to overwrite the untracked symlink, he has git-clean and git-checkout -f at his disposal. Signed-off-by: Clemens Buchacher <drizzd@aon.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'symlinks.c')
-rw-r--r--symlinks.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/symlinks.c b/symlinks.c
index 3cacebd91a..034943bda0 100644
--- a/symlinks.c
+++ b/symlinks.c
@@ -223,7 +223,7 @@ int check_leading_path(const char *name, int len)
int flags;
int match_len = lstat_cache_matchlen(cache, name, len, &flags,
FL_SYMLINK|FL_NOENT|FL_DIR, USE_ONLY_LSTAT);
- if (flags & (FL_SYMLINK|FL_NOENT))
+ if (flags & FL_NOENT)
return 0;
else if (flags & FL_DIR)
return -1;