git: load into arbitrary dive tables

The git parser loads into the global dive table, even if it
is called indirectly via parse_file(). However, parse_file()
may be given a different table. Fix this by extending the
git parser state.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2020-03-17 22:49:29 +01:00 committed by Dirk Hohndel
parent 2042a47230
commit ed3e68c36a
4 changed files with 13 additions and 7 deletions

View file

@ -325,7 +325,7 @@ int parse_file(const char *filename, struct dive_table *table, struct trip_table
}
free(current_sha);
if (git)
return git_load_dives(git, branch);
return git_load_dives(git, branch, table, trips, sites);
if ((ret = readfile(filename, &mem)) < 0) {
/* we don't want to display an error if this was the default file */