summaryrefslogtreecommitdiff
path: root/sha1_name.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2017-05-19 12:52:00 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-05-24 01:59:27 (GMT)
commit62faad5aa5441942c333c15f3afa03a6e2dd994d (patch)
tree21f47d8f1c7c5a134f38c26fb0a8050223b9f09f /sha1_name.c
parentd89797feff053bba939b62ee442f56e3fc98062b (diff)
downloadgit-62faad5aa5441942c333c15f3afa03a6e2dd994d.zip
git-62faad5aa5441942c333c15f3afa03a6e2dd994d.tar.gz
git-62faad5aa5441942c333c15f3afa03a6e2dd994d.tar.bz2
handle_revision_arg: add handle_dotdot() helper
The handle_revision_arg function is rather long, and a big chunk of it is handling the range operators. Let's pull that out to a separate helper. While we're doing so, we can clean up a few of the rough edges that made the flow hard to follow: - instead of manually restoring *dotdot (that we overwrote with a NUL), do the real work in a sub-helper, which makes it clear that the munge/restore lines are a matched pair - eliminate a goto which wasn't actually used for control flow, but only to avoid duplicating a few lines (instead, those lines are pushed into another helper function) - use early returns instead of deep nesting - consistently name all variables for the left-hand side of the range as "a" (rather than "this" or "from") and the right-hand side as "b" (rather than "next", or using the unadorned "sha1" or "flags" from the main function). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'sha1_name.c')
0 files changed, 0 insertions, 0 deletions