summaryrefslogtreecommitdiff
path: root/cache.h
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2022-01-05 14:01:28 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2022-01-05 14:01:28 -0800
commitda81d473fcfa67dfbcf0504d2b5225885e51e532 (patch)
tree69f054e9d22dac00cf4b68705f3ab28dbb51a0b2 /cache.h
parentMerge branch 'jc/flex-array-definition' (diff)
parentt2501: simplify the tests since we can now assume desired behavior (diff)
downloadtgif-da81d473fcfa67dfbcf0504d2b5225885e51e532.tar.xz
Merge branch 'en/keep-cwd'
Many git commands that deal with working tree files try to remove a directory that becomes empty (i.e. "git switch" from a branch that has the directory to another branch that does not would attempt remove all files in the directory and the directory itself). This drops users into an unfamiliar situation if the command was run in a subdirectory that becomes subject to removal due to the command. The commands have been taught to keep an empty directory if it is the directory they were started in to avoid surprising users. * en/keep-cwd: t2501: simplify the tests since we can now assume desired behavior dir: new flag to remove_dir_recurse() to spare the original_cwd dir: avoid incidentally removing the original_cwd in remove_path() stash: do not attempt to remove startup_info->original_cwd rebase: do not attempt to remove startup_info->original_cwd clean: do not attempt to remove startup_info->original_cwd symlinks: do not include startup_info->original_cwd in dir removal unpack-trees: add special cwd handling unpack-trees: refuse to remove startup_info->original_cwd setup: introduce startup_info->original_cwd t2501: add various tests for removing the current working directory
Diffstat (limited to 'cache.h')
-rw-r--r--cache.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/cache.h b/cache.h
index cfba463aa9..5d7463e6fb 100644
--- a/cache.h
+++ b/cache.h
@@ -1846,8 +1846,10 @@ void overlay_tree_on_index(struct index_state *istate,
struct startup_info {
int have_repository;
const char *prefix;
+ const char *original_cwd;
};
extern struct startup_info *startup_info;
+extern const char *tmp_original_cwd;
/* merge.c */
struct commit_list;