]> git.ipfire.org Git - thirdparty/git.git/blobdiff - refs/files-backend.c
refs files-backend: assume cb->newlog if !EXPIRE_REFLOGS_DRY_RUN
[thirdparty/git.git] / refs / files-backend.c
index 90b671025a742d743cfeac118348de516c0425f9..5f8586a36e351219e966662bfdd62ebaa169d0a1 100644 (file)
@@ -3105,12 +3105,12 @@ static int expire_reflog_ent(struct object_id *ooid, struct object_id *noid,
 
        if ((*cb->should_prune_fn)(ooid, noid, email, timestamp, tz,
                                   message, policy_cb)) {
-               if (!cb->newlog)
+               if (cb->flags & EXPIRE_REFLOGS_DRY_RUN)
                        printf("would prune %s", message);
                else if (cb->flags & EXPIRE_REFLOGS_VERBOSE)
                        printf("prune %s", message);
        } else {
-               if (cb->newlog) {
+               if (!(cb->flags & EXPIRE_REFLOGS_DRY_RUN)) {
                        fprintf(cb->newlog, "%s %s %s %"PRItime" %+05d\t%s",
                                oid_to_hex(ooid), oid_to_hex(noid),
                                email, timestamp, tz, message);