GNOME Bugzilla – Bug 742454
ostree refs --delete=PREFIX deletes everything
Last modified: 2015-01-06 15:46:23 UTC
All refs are deleted when you run the following command: # ostree --repo=/mine refs --delete=PREFIX Even though this is how 'ostree refs' is documented to work # ostree refs --help Usage: ostree refs [OPTION...] [PREFIX] - List refs Help Options: -h, --help Show help options Application Options: --delete=PREFIX Delete refs which match PREFIX, rather than listing them
Ugh, the help output is wrong. --delete doesn't actually take an argument, the PREFIX is specified separately. Looks like this has been a bug from the beginning: https://git.gnome.org/browse/ostree/diff/src/ostree/ot-builtin-refs.c?id=dc0f3c3dcbdd63d6a41ebc172b38c65576db9cd3 I wonder if a PREFIX should be mandatory when using --delete to prevent accidents like this.
Created attachment 293937 [details] [review] Proposed patch
Review of attachment 293937 [details] [review]: Ouch. Yes. Can you also add a test case to `tests/test-basic.sh`? There are already a few refs tests there. Good to commit with that change.
Pushed with a test case. https://git.gnome.org/browse/ostree/commit/?id=7727fe84d90099efadb535538f9aa22d83f78507