Patrick Steinhardt
e3209bd4df
builtin/stash: fix --keep-index --include-untracked with empty HEAD
...
It was reported that creating a stash with `--keep-index
--include-untracked` causes an error when HEAD points to a commit whose
tree is empty:
$ git stash push --keep-index --include-untracked
error: pathspec ':/' did not match any file(s) known to git
This error comes from `git checkout --no-overlay $i_tree -- :/`, which
we execute to reset the working tree to the state in our index. As the
tree generated from the index is empty in our case, ':/' does not match
any files and thus causes git-checkout(1) to error out.
Fix the issue by skipping the checkout when the index tree is empty. As
explained in the in-code comment, this should be the correct thing to do
as there is nothing that we'd have to reset in the first place.
Reported-by: Piotr Siupa <piotrsiupa@gmail.com >
Signed-off-by: Patrick Steinhardt <ps@pks.im >
Signed-off-by: Junio C Hamano <gitster@pobox.com >
2024-08-16 09:50:33 -07:00
..
2023-02-06 15:03:34 -08:00
2023-02-22 14:55:45 -08:00
2022-04-06 09:42:14 -07:00
2022-08-19 11:13:14 -07:00
2023-01-13 14:17:14 -08:00
2022-10-13 09:32:57 -07:00
2023-02-14 14:15:55 -08:00
2022-11-21 12:32:48 +09:00
2023-02-14 14:15:50 -08:00
2023-01-05 15:07:17 +09:00
2023-01-14 08:49:55 -08:00
2022-11-21 12:06:15 +09:00
2022-07-01 11:43:42 -07:00
2021-10-15 13:09:40 -07:00
2022-11-21 12:06:15 +09:00
2023-02-06 15:03:34 -08:00
2023-02-22 14:55:45 -08:00
2024-05-24 12:29:36 -07:00
2023-02-06 15:34:38 -08:00
2022-10-13 09:32:57 -07:00
2023-02-10 11:38:40 -08:00
2022-11-21 12:32:48 +09:00
2022-02-04 13:58:28 -08:00
2023-02-22 15:18:58 -08:00
2021-10-28 09:57:09 -07:00
2022-11-21 12:06:15 +09:00
2022-10-28 11:26:54 -07:00
2022-11-21 12:06:15 +09:00
2022-11-21 12:06:15 +09:00
2022-11-21 12:06:15 +09:00
2022-12-14 15:55:46 +09:00
2023-01-17 14:32:06 -08:00
2022-12-13 22:16:23 +09:00
2022-09-01 10:49:48 -07:00
2022-09-12 08:38:59 -07:00
2023-02-21 12:09:40 -08:00
2021-12-20 14:55:02 -08:00
2021-10-20 14:33:07 -07:00
2022-11-14 22:39:25 -05:00
2022-11-21 12:06:15 +09:00
2022-12-19 11:46:17 +09:00
2022-11-23 11:22:24 +09:00
2022-11-21 12:06:14 +09:00
2023-01-27 08:51:41 -08:00
2022-10-28 11:26:54 -07:00
2023-02-08 12:50:03 -08:00
2022-06-17 10:38:26 -07:00
2024-04-17 22:30:10 +02:00
2022-10-13 09:32:57 -07:00
2023-02-17 15:43:09 -08:00
2022-11-21 12:32:48 +09:00
2023-02-10 21:57:51 -08:00
2023-02-14 14:15:52 -08:00
2022-05-20 15:26:59 -07:00
2022-10-13 09:32:56 -07:00
2022-07-01 11:43:43 -07:00
2022-11-21 12:06:15 +09:00
2022-11-21 12:06:15 +09:00
2022-03-07 11:57:52 -08:00
2022-12-26 11:42:05 +09:00
2023-02-22 14:55:45 -08:00
2022-03-16 17:53:08 -07:00
2022-06-21 10:12:15 -07:00
2022-10-06 09:56:51 -07:00
2023-02-10 11:37:27 -08:00
2023-02-22 14:55:45 -08:00
2022-11-16 14:57:32 -05:00
2023-02-15 17:11:53 -08:00
2022-10-13 09:32:56 -07:00
2022-10-13 09:32:56 -07:00
2022-10-24 15:44:20 -07:00
2022-02-04 13:58:28 -08:00
2022-11-21 15:58:54 +09:00
2022-11-21 12:06:15 +09:00
2023-02-06 15:34:40 -08:00
2022-12-02 08:25:29 +09:00
2022-12-26 10:21:44 +09:00
2023-02-06 16:03:53 -08:00
2023-02-06 15:34:40 -08:00
2022-09-19 11:11:11 -07:00
2023-01-08 10:34:37 +09:00
2023-01-08 10:34:35 +09:00
2022-11-08 17:15:12 -05:00
2023-02-06 15:34:37 -08:00
2022-08-05 14:13:12 -07:00
2022-12-13 22:16:23 +09:00
2023-02-22 14:55:45 -08:00
2022-11-23 11:22:25 +09:00
2022-12-14 15:55:46 +09:00
2023-02-06 16:03:52 -08:00
2023-02-10 11:31:16 -08:00
2022-10-13 09:32:56 -07:00
2022-10-24 14:48:05 -07:00
2023-02-06 15:34:39 -08:00
2022-10-28 11:26:54 -07:00
2023-01-17 14:32:06 -08:00
2024-08-16 09:50:33 -07:00
2022-02-04 13:58:28 -08:00
2024-04-19 12:38:37 +02:00
2022-10-28 11:26:54 -07:00
2022-10-13 09:32:56 -07:00
2022-11-21 12:32:48 +09:00
2022-06-13 10:22:36 -07:00
2023-02-10 11:37:27 -08:00
2022-10-13 09:32:56 -07:00
2022-10-13 09:32:56 -07:00
2024-04-17 22:29:56 +02:00
2022-12-18 11:48:26 +09:00
2022-10-13 09:32:56 -07:00
2022-10-13 09:32:56 -07:00
2022-10-13 09:32:56 -07:00
2023-02-06 15:34:38 -08:00
2023-02-10 11:37:49 -08:00