Cleanup: use clear_git_id() instead of setting saved_git_id

For better encapsulation, use clear_git_id() in clear_dive_file_data()
instead of setting saved_git_id directly.

Thus, memory management of the saved_git_id value is encapsulated
and can be modified more easily.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2019-07-25 07:25:54 +02:00 committed by Dirk Hohndel
parent 891d21b34e
commit ba4d6ae627
2 changed files with 2 additions and 2 deletions

View file

@ -1488,7 +1488,7 @@ void clear_dive_file_data()
clear_dive(&displayed_dive);
reset_min_datafile_version();
saved_git_id = "";
clear_git_id();
}
bool dive_less_than(const struct dive *a, const struct dive *b)

View file

@ -1625,7 +1625,7 @@ void clear_git_id(void)
saved_git_id = NULL;
}
void set_git_id(const struct git_oid * id)
void set_git_id(const struct git_oid *id)
{
static char git_id_buffer[GIT_OID_HEXSZ + 1];