Mercurial > hg
diff tests/test-shelve2.t @ 46289:c062874a35db
shelve: don't crash on file with unexpected extension in .hg/shelved/
We assumed that the files in the `.hg/shelved/` directory have an
extension. That's a valid assumption except that users may put garbage
in the directory. This patch fixes the crash by simply not assuming
that the result of splittin a string at '.' yields an extension. We
don't use the extension since the previous patch anyway.
Differential Revision: https://phab.mercurial-scm.org/D9720
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Fri, 08 Jan 2021 23:08:37 -0800 |
parents | 61f8fc12e167 |
children | bcc4820242cf |
line wrap: on
line diff
--- a/tests/test-shelve2.t Mon Jan 11 09:26:48 2021 -0800 +++ b/tests/test-shelve2.t Fri Jan 08 23:08:37 2021 -0800 @@ -779,10 +779,10 @@ # A file with an unexpected extension $ touch .hg/shelved/junk3 - $ hg shelve -l 2>&1 | grep ValueError - ValueError: * (glob) - $ hg unshelve 2>&1 | grep ValueError - ValueError: * (glob) + $ hg shelve -l + $ hg unshelve + abort: no shelved changes to apply! + [20] $ hg shelve -d junk3 abort: shelved change 'junk3' not found [10]