summaryrefslogtreecommitdiff
path: root/builtin/am.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2021-10-13 15:15:57 -0700
committerJunio C Hamano <gitster@pobox.com>2021-10-13 15:15:57 -0700
commita7c2daa06d6f7d8fd13a1d72f23741acbaeba522 (patch)
treeb1b0095d267b98188a7ae24ac77934298b665649 /builtin/am.c
parent1fdfb774aaaa0ee8acb0a1ec9b601e5a2d2999f1 (diff)
parent0e29222e0c2f68118cdd3412515539b74433b732 (diff)
downloadgit-a7c2daa06d6f7d8fd13a1d72f23741acbaeba522.tar.gz
Merge branch 'en/removing-untracked-fixes'
Various fixes in code paths that move untracked files away to make room. * en/removing-untracked-fixes: Documentation: call out commands that nuke untracked files/directories Comment important codepaths regarding nuking untracked files/dirs unpack-trees: avoid nuking untracked dir in way of locally deleted file unpack-trees: avoid nuking untracked dir in way of unmerged file Change unpack_trees' 'reset' flag into an enum Remove ignored files by default when they are in the way unpack-trees: make dir an internal-only struct unpack-trees: introduce preserve_ignored to unpack_trees_options read-tree, merge-recursive: overwrite ignored files by default checkout, read-tree: fix leak of unpack_trees_options.dir t2500: add various tests for nuking untracked files
Diffstat (limited to 'builtin/am.c')
-rw-r--r--builtin/am.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/builtin/am.c b/builtin/am.c
index e4a0ff9cd7..f296226e95 100644
--- a/builtin/am.c
+++ b/builtin/am.c
@@ -1917,7 +1917,8 @@ static int fast_forward_to(struct tree *head, struct tree *remote, int reset)
opts.dst_index = &the_index;
opts.update = 1;
opts.merge = 1;
- opts.reset = reset;
+ opts.reset = reset ? UNPACK_RESET_PROTECT_UNTRACKED : 0;
+ opts.preserve_ignored = 0; /* FIXME: !overwrite_ignore */
opts.fn = twoway_merge;
init_tree_desc(&t[0], head->buffer, head->size);
init_tree_desc(&t[1], remote->buffer, remote->size);