checkout,merge: loosen overwriting untracked file check based on info/exclude
Back in 1127148 (Loosen "working file will be lost" check in Porcelain-ish - 2006-12-04), git-checkout.sh learned to quietly overwrite ignored files. Howver the code only took .gitignore files into account. Standard ignored files include all specified in .gitignore files in working directory _and_ $GIT_DIR/info/exclude. This patch makes sure ignored files in info/exclude can also be overwritten automatically in the spirit of the original patch. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Nguyễn Thái Ngọc Duy committed
Nov 27, 2011 at 17:15 UTC
fc001b526c42e5fb776340136a2fb247e391a61b
2 files changed
+2
-2
builtin/checkout.c
+1
-1
@@ -401,7 +401,7 @@ static int merge_working_tree(struct checkout_opts *opts,
401
topts.fn = twoway_merge;
402
topts.dir = xcalloc(1, sizeof(*topts.dir));
403
topts.dir->flags |= DIR_SHOW_IGNORED;
404
- topts.dir->exclude_per_dir = ".gitignore";
404
+ setup_standard_excludes(topts.dir);
405
tree = parse_tree_indirect(old->commit ?
406
old->commit->object.sha1 :
407
(unsigned char *)EMPTY_TREE_SHA1_BIN);
builtin/merge.c
+1
-1
@@ -708,7 +708,7 @@ int checkout_fast_forward(const unsigned char *head, const unsigned char *remote
708
memset(&t, 0, sizeof(t));
709
memset(&dir, 0, sizeof(dir));
710
dir.flags |= DIR_SHOW_IGNORED;
711
- dir.exclude_per_dir = ".gitignore";
711
+ setup_standard_excludes(&dir);
712
opts.dir = &dir;
713
714
opts.head_idx = 1;