diff options
author | Ramkumar Ramachandra <artagnon@gmail.com> | 2011-08-04 16:09:07 +0530 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-08-04 15:40:43 -0700 |
commit | 9044143ff150a4ccc834523ae2f9ee11c2c961c3 (patch) | |
tree | d5430d126f887285122b72fc9856b48a6bc478e7 /builtin/gc.c | |
parent | revert: Separate cmdline parsing from functional code (diff) | |
download | tgif-9044143ff150a4ccc834523ae2f9ee11c2c961c3.tar.xz |
revert: Don't create invalid replay_opts in parse_args
The "--ff" command-line option cannot be used with some other
command-line options. However, parse_args still parses these
incompatible options into a replay_opts structure for use by the rest
of the program. Although pick_commits, the current gatekeeper to the
cherry-pick machinery, checks the validity of the replay_opts
structure before before starting its operation, there will be multiple
entry points to the cherry-pick machinery in future. To futureproof
the code and catch these errors in one place, make sure that an
invalid replay_opts structure is not created by parse_args in the
first place. We still check the replay_opts structure for validity in
pick_commits, but this is an assert() now to emphasize that it's the
caller's responsibility to get it right.
Inspired-by: Christian Couder <chriscool@tuxfamily.org>
Mentored-by: Jonathan Nieder <jrnieder@gmail.com>
Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/gc.c')
0 files changed, 0 insertions, 0 deletions