Elijah Newren
351ea1c3cb
dir, clean: avoid disallowed behavior
...
dir.h documented quite clearly that DIR_SHOW_IGNORED and
DIR_SHOW_IGNORED_TOO are mutually exclusive, with a big comment to this
effect by the definition of both enum values. However, a command like
git clean -fx $DIR
would set both values for dir.flags. I _think_ it happened to work
because:
* As dir.h points out, DIR_KEEP_UNTRACKED_CONTENTS only takes effect
if DIR_SHOW_IGNORED_TOO is set.
* As coded, I believe DIR_SHOW_IGNORED would just happen to take
precedence over DIR_SHOW_IGNORED_TOO in the code as currently
constructed.
Which is a long way of saying "we just got lucky".
Fix clean.c to avoid setting these mutually exclusive values at the same
time, and add a check to dir.c that will throw a BUG() to prevent anyone
else from making this mistake.
Signed-off-by: Elijah Newren <newren@gmail.com >
Signed-off-by: Junio C Hamano <gitster@pobox.com >
2020-06-12 17:27:16 -07:00
..
2020-04-28 10:47:10 -07:00
2020-05-07 12:24:35 -07:00
2019-01-02 13:05:30 -08:00
2020-02-19 09:37:14 -08:00
2020-05-05 14:54:27 -07:00
2020-05-08 14:25:04 -07:00
2019-11-11 11:46:29 +09:00
2020-04-28 10:47:10 -07:00
2019-01-24 11:55:06 -08:00
2020-02-18 15:28:58 -08:00
2020-04-28 10:47:10 -07:00
2020-05-08 14:25:08 -07:00
2020-06-12 17:27:16 -07:00
2020-04-28 15:50:00 -07:00
2019-05-13 14:22:53 +09:00
2020-05-01 13:39:53 -07:00
2020-04-28 10:47:10 -07:00
2020-05-13 12:19:19 -07:00
2020-02-10 10:49:12 -08:00
2018-11-13 14:22:02 +09:00
2020-03-26 17:11:21 -07:00
2019-01-24 11:55:06 -08:00
2019-01-24 11:55:06 -08:00
2020-04-20 18:22:54 -07:00
2020-03-30 10:59:08 -07:00
2019-10-07 10:20:12 +09:00
2019-07-11 14:31:04 -07:00
2020-02-14 12:54:22 -08:00
2020-03-30 10:59:08 -07:00
2020-05-13 12:19:19 -07:00
2020-03-24 15:04:43 -07:00
2020-05-08 14:25:04 -07:00
2020-05-24 19:39:39 -07:00
2020-02-04 11:36:37 -08:00
2019-04-01 11:57:39 +09:00
2020-05-05 14:54:27 -07:00
2019-05-13 14:22:53 +09:00
2020-05-01 13:39:59 -07:00
2020-04-02 12:42:32 -07:00
2020-03-26 17:11:20 -07:00
2020-04-28 10:47:10 -07:00
2020-05-05 14:54:27 -07:00
2020-05-05 14:54:27 -07:00
2019-03-21 12:03:35 +09:00
2019-01-14 15:29:28 -08:00
2020-02-11 09:59:39 -08:00
2018-11-06 12:56:29 +09:00
2019-01-24 11:55:06 -08:00
2019-01-24 11:55:06 -08:00
2019-08-19 10:08:03 -07:00
2019-08-22 12:34:10 -07:00
2020-05-13 12:19:19 -07:00
2020-01-31 10:45:39 -08:00
2019-05-13 14:22:54 +09:00
2019-10-23 12:05:06 +09:00
2019-01-24 11:55:06 -08:00
2020-02-05 10:36:33 -08:00
2020-04-28 10:47:10 -07:00
2020-05-13 12:19:18 -07:00
2019-04-01 11:57:38 +09:00
2019-04-26 10:54:03 +09:00
2019-12-09 12:26:40 -08:00
2020-03-24 15:04:44 -07:00
2020-05-13 12:19:18 -07:00
2020-05-05 14:54:27 -07:00
2020-05-05 14:54:28 -07:00
2019-12-06 12:36:53 -08:00
2020-04-28 10:47:10 -07:00
2020-05-13 12:19:19 -07:00
2020-05-13 12:19:18 -07:00
2020-04-10 14:44:29 -07:00
2020-04-28 10:47:10 -07:00
2020-05-13 12:19:18 -07:00
2020-01-31 10:45:39 -08:00
2019-01-15 15:38:29 -08:00
2020-04-28 10:47:10 -07:00
2020-02-18 13:21:46 -08:00
2020-05-13 12:19:18 -07:00
2019-07-19 11:30:21 -07:00
2020-02-19 10:56:49 -08:00
2020-04-28 10:47:10 -07:00
2020-04-28 10:47:10 -07:00
2020-04-28 10:47:10 -07:00
2019-08-19 15:04:59 -07:00
2020-04-28 10:47:10 -07:00
2020-03-27 11:33:31 -07:00
2020-04-29 16:15:31 -07:00
2018-12-26 15:41:47 -08:00
2020-05-08 09:17:55 -07:00
2020-05-08 14:25:04 -07:00
2020-01-31 10:45:39 -08:00
2020-04-28 10:47:10 -07:00
2020-04-02 11:09:49 -07:00
2018-10-26 10:17:59 +09:00
2019-05-13 14:22:53 +09:00
2019-07-31 14:38:56 -07:00
2019-06-19 08:19:21 -07:00
2020-03-10 11:41:40 -07:00
2019-05-13 14:22:53 +09:00