-
-
Notifications
You must be signed in to change notification settings - Fork 389
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
prune: Skip calculating potential freed space in the dry run #5813
base: main
Are you sure you want to change the base?
Conversation
n_objects_pruned, formatted_freed_size); | ||
if (!opt_prune_dry_run) | ||
{ | ||
formatted_freed_size = g_format_size_full (objsize_total, 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The declaration of the formatted_freed_size
variable should be moved to this if block now.
But, what's the reasoning for not printing this on dry runs? Does it always return zero or a bogus value on dry runs?
The commit message could have some of that reasoning.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The data will be null/zero because it will no longer traverse all objects.
if (!dry_run) | ||
{ | ||
g_info ("Pruning unreachable objects"); | ||
g_timer_start (timer); | ||
|
||
if (!prune_unreachable_loose_objects (repo, &data, cancellable, error)) | ||
return FALSE; | ||
if (!prune_unreachable_loose_objects (repo, &data, cancellable, error)) | ||
return FALSE; | ||
|
||
g_timer_stop (timer); | ||
g_info ("Elapsed time: %.1f sec", g_timer_elapsed (timer, NULL)); | ||
g_timer_stop (timer); | ||
g_info ("Elapsed time: %.1f sec", g_timer_elapsed (timer, NULL)); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well this is not just "calculating", right? This is actually pruning stuff on a dry run, seems like an actual problem here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not actually pruning. Somewhere down the stackcode there's data.dont_prune
defined that causes this function to stat
/statx
each object to calculate potential space-saving.
No description provided.