mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Simplify git tracking of git tree creation
With Linus' changes to the tree creation saving the dives is no longer the dominant part of that process, so simplify the output (which also removes the hacky buggy code to show the percentages that is of course totally bogus). (apparently a couple of white space cleanups snuck into this patch) Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
afb5bb8b06
commit
a1332ce361
1 changed files with 10 additions and 16 deletions
|
@ -923,6 +923,7 @@ static int create_git_tree(git_repository *repo, struct dir *root, bool select_o
|
|||
struct dive *dive;
|
||||
dive_trip_t *trip;
|
||||
|
||||
git_storage_update_progress(20, "start create git tree");
|
||||
save_settings(repo, root);
|
||||
|
||||
save_divesites(repo, root);
|
||||
|
@ -931,19 +932,11 @@ static int create_git_tree(git_repository *repo, struct dir *root, bool select_o
|
|||
trip->index = 0;
|
||||
|
||||
/* save the dives */
|
||||
int notify_increment = dive_table.nr > 10 ? dive_table.nr / 10 : 1;
|
||||
int last_threshold = 0;
|
||||
git_storage_update_progress(22, "start saving dives");
|
||||
for_each_dive(i, dive) {
|
||||
struct tm tm;
|
||||
struct dir *tree;
|
||||
char buf[] = "save dives x0%";
|
||||
|
||||
if (i / notify_increment > last_threshold) {
|
||||
// notify of progress - we cover the range of 20..50
|
||||
last_threshold = i / notify_increment;
|
||||
buf[11] = last_threshold + '0';
|
||||
git_storage_update_progress(20 + 3 * last_threshold, buf);
|
||||
}
|
||||
|
||||
trip = dive->divetrip;
|
||||
|
||||
|
@ -972,6 +965,7 @@ static int create_git_tree(git_repository *repo, struct dir *root, bool select_o
|
|||
|
||||
save_one_dive(repo, tree, dive, &tm, cached_ok);
|
||||
}
|
||||
git_storage_update_progress(25, "done creating git tree");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue