]> git.ipfire.org Git - thirdparty/git.git/commit
sequencer: make read_oneliner() accept flags
authorDenton Liu <liu.denton@gmail.com>
Tue, 7 Apr 2020 14:27:52 +0000 (10:27 -0400)
committerJunio C Hamano <gitster@pobox.com>
Tue, 7 Apr 2020 23:57:30 +0000 (16:57 -0700)
commit3442c3d11df16d7cd3867b133a8ec6ddd21a8839
treeea10198679cad873a98dc8e506502b14f5eed520
parent5b2f6d9cd50b1c8909326c7175aef288a9915f33
sequencer: make read_oneliner() accept flags

In a future commit, we will need read_oneliner() to accept flags other
than just `skip_if_empty`. Instead of having an argument for each flag,
teach read_oneliner() to accept the bitfield `flags` instead. For now,
only recognize the `READ_ONELINER_SKIP_IF_EMPTY` flag. More flags will
be added in a future commit.

The result of this is that parallel topics which introduce invocations
of read_oneliner() will still be compatible with this new function
signature since, instead of passing 1 or 0 for `skip_if_empty`, they'll
be passing 1 or 0 to `flags`, which gives equivalent behavior.

Mechanically fix up invocations of read_oneliner() with the following
spatch

@@
expression a, b;
@@
  read_oneliner(a, b,
- 1
+ READ_ONELINER_SKIP_IF_EMPTY
  )

and manually break up long lines in the result.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
sequencer.c