From b817e545338cdb737b3deebf4917afb4a18ede57 Mon Sep 17 00:00:00 2001 From: Elijah Newren Date: Thu, 9 Dec 2021 05:08:27 +0000 Subject: unpack-trees: refuse to remove startup_info->original_cwd MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In the past, when a directory needs to be removed to make room for a file, we have always errored out when that directory contains any untracked (but not ignored) files. Add an extra condition on that: also error out if the directory is the current working directory we inherited from our parent process. Acked-by: Derrick Stolee Acked-by: Ævar Arnfjörð Bjarmason Signed-off-by: Elijah Newren Signed-off-by: Junio C Hamano --- unpack-trees.h | 1 + 1 file changed, 1 insertion(+) (limited to 'unpack-trees.h') diff --git a/unpack-trees.h b/unpack-trees.h index 71ffb7eeb0..efb9edfbb2 100644 --- a/unpack-trees.h +++ b/unpack-trees.h @@ -19,6 +19,7 @@ enum unpack_trees_error_types { ERROR_WOULD_OVERWRITE = 0, ERROR_NOT_UPTODATE_FILE, ERROR_NOT_UPTODATE_DIR, + ERROR_CWD_IN_THE_WAY, ERROR_WOULD_LOSE_UNTRACKED_OVERWRITTEN, ERROR_WOULD_LOSE_UNTRACKED_REMOVED, ERROR_BIND_OVERLAP, -- cgit v1.2.1