Commit 04988c8
unpack-trees: introduce preserve_ignored to unpack_trees_options
Currently, every caller of unpack_trees() that wants to ensure ignored
files are overwritten by default needs to:
* allocate unpack_trees_options.dir
* flip the DIR_SHOW_IGNORED flag in unpack_trees_options.dir->flags
* call setup_standard_excludes
AND then after the call to unpack_trees() needs to
* call dir_clear()
* deallocate unpack_trees_options.dir
That's a fair amount of boilerplate, and every caller uses identical
code. Make this easier by instead introducing a new boolean value where
the default value (0) does what we want so that new callers of
unpack_trees() automatically get the appropriate behavior. And move all
the handling of unpack_trees_options.dir into unpack_trees() itself.
While preserve_ignored = 0 is the behavior we feel is the appropriate
default, we defer fixing commands to use the appropriate default until a
later commit. So, this commit introduces several locations where we
manually set preserve_ignored=1. This makes it clear where code paths
were previously preserving ignored files when they should not have been;
a future commit will flip these to instead use a value of 0 to get the
behavior we want.
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>1 parent 491a757 commit 04988c8
File tree
14 files changed
+35
-40
lines changed- builtin
14 files changed
+35
-40
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1919 | 1919 | | |
1920 | 1920 | | |
1921 | 1921 | | |
| 1922 | + | |
| 1923 | + | |
| 1924 | + | |
1922 | 1925 | | |
1923 | 1926 | | |
1924 | 1927 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
648 | 648 | | |
649 | 649 | | |
650 | 650 | | |
| 651 | + | |
651 | 652 | | |
652 | 653 | | |
653 | 654 | | |
| |||
746 | 747 | | |
747 | 748 | | |
748 | 749 | | |
749 | | - | |
750 | | - | |
751 | | - | |
752 | | - | |
753 | | - | |
| 750 | + | |
754 | 751 | | |
755 | 752 | | |
756 | 753 | | |
| |||
760 | 757 | | |
761 | 758 | | |
762 | 759 | | |
763 | | - | |
764 | | - | |
765 | | - | |
766 | | - | |
767 | 760 | | |
768 | 761 | | |
769 | 762 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
803 | 803 | | |
804 | 804 | | |
805 | 805 | | |
| 806 | + | |
| 807 | + | |
806 | 808 | | |
807 | 809 | | |
808 | 810 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
681 | 681 | | |
682 | 682 | | |
683 | 683 | | |
| 684 | + | |
| 685 | + | |
684 | 686 | | |
685 | 687 | | |
686 | 688 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
201 | 201 | | |
202 | 202 | | |
203 | 203 | | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
209 | 207 | | |
210 | 208 | | |
211 | 209 | | |
| |||
245 | 243 | | |
246 | 244 | | |
247 | 245 | | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | 246 | | |
254 | 247 | | |
255 | 248 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| 70 | + | |
| 71 | + | |
70 | 72 | | |
71 | 73 | | |
72 | 74 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
258 | 258 | | |
259 | 259 | | |
260 | 260 | | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
261 | 264 | | |
262 | 265 | | |
263 | 266 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4045 | 4045 | | |
4046 | 4046 | | |
4047 | 4047 | | |
4048 | | - | |
4049 | | - | |
4050 | | - | |
4051 | | - | |
4052 | | - | |
| 4048 | + | |
4053 | 4049 | | |
4054 | 4050 | | |
4055 | 4051 | | |
4056 | 4052 | | |
4057 | 4053 | | |
4058 | 4054 | | |
4059 | 4055 | | |
4060 | | - | |
4061 | | - | |
4062 | 4056 | | |
4063 | 4057 | | |
4064 | 4058 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
411 | 411 | | |
412 | 412 | | |
413 | 413 | | |
414 | | - | |
415 | | - | |
416 | | - | |
| 414 | + | |
417 | 415 | | |
418 | 416 | | |
419 | 417 | | |
| |||
428 | 426 | | |
429 | 427 | | |
430 | 428 | | |
431 | | - | |
432 | | - | |
433 | | - | |
434 | | - | |
435 | 429 | | |
436 | 430 | | |
437 | 431 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
57 | 56 | | |
58 | 57 | | |
59 | 58 | | |
| |||
80 | 79 | | |
81 | 80 | | |
82 | 81 | | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
| 82 | + | |
88 | 83 | | |
89 | 84 | | |
90 | 85 | | |
| |||
101 | 96 | | |
102 | 97 | | |
103 | 98 | | |
104 | | - | |
105 | 99 | | |
106 | 100 | | |
107 | 101 | | |
| |||
0 commit comments