notes: extract logic into set_display_notes()
Instead of open coding the logic that tweaks the variables in `struct display_notes_opt` within handle_revision_opt(), abstract away the logic into set_display_notes() so that it can be reused. Signed-off-by: Denton Liu <liu.denton@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
e6e230eeae
commit
452538c358
10
notes.h
10
notes.h
@@ -265,6 +265,16 @@ struct display_notes_opt {
|
||||
*/
|
||||
void init_display_notes(struct display_notes_opt *opt);
|
||||
|
||||
/*
|
||||
* Set a display_notes_opt to a given state. 'show_notes' is a boolean
|
||||
* representing whether or not to show notes. 'opt_ref' points to a
|
||||
* string for the notes ref, or is NULL if the default notes should be
|
||||
* used.
|
||||
*
|
||||
* Return 'show_notes' normalized to 1 or 0.
|
||||
*/
|
||||
int set_display_notes(struct display_notes_opt *opt, int show_notes, const char *opt_ref);
|
||||
|
||||
/*
|
||||
* Load the notes machinery for displaying several notes trees.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user