diff options
author | Alexandr Miloslavskiy <alexandr.miloslavskiy@syntevo.com> | 2020-02-17 17:25:21 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-02-19 10:56:49 -0800 |
commit | 8c3713cede71e4741dac546f787734627329f55b (patch) | |
tree | 41eddf353ac3f6cbeca3e81c86536278712cb58a /t/chainlint/cuddled-loop.expect | |
parent | doc: stash: synchronize <pathspec> description (diff) | |
download | tgif-8c3713cede71e4741dac546f787734627329f55b.tar.xz |
stash: eliminate crude option parsing
Eliminate crude option parsing and rely on real parsing instead, because
1) Crude parsing is crude, for example it's not capable of
handling things like `git stash -m Message`
2) Adding options in two places is inconvenient and prone to bugs
As a side result, the case of `git stash -m Message` gets fixed.
Also give a good error message instead of just throwing usage at user.
----
Some review of what's been happening to this code:
Before [1], `git-stash.sh` only verified that all args begin with `-` :
# The default command is "push" if nothing but options are given
seen_non_option=
for opt
do
case "$opt" in
--) break ;;
-*) ;;
*) seen_non_option=t; break ;;
esac
done
Later, [1] introduced the duplicate code I'm now removing, also making
the previous test more strict by white-listing options.
----
[1] Commit 40af1468 ("stash: convert `stash--helper.c` into `stash.c`" 2019-02-26)
Signed-off-by: Alexandr Miloslavskiy <alexandr.miloslavskiy@syntevo.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/chainlint/cuddled-loop.expect')
0 files changed, 0 insertions, 0 deletions