Thread (221 messages) 221 messages, 6 authors, 2022-07-12
STALE1430d
Revisions (6)
  1. v1 current
  2. v2 [diff vs current]
  3. v3 [diff vs current]
  4. v4 [diff vs current]
  5. v5 [diff vs current]
  6. v6 [diff vs current]

[PATCH 13/24] revisions API users: use release_revisions() in wt-status.c edge case

From: Ævar Arnfjörð Bjarmason <hidden>
Date: 2022-03-09 13:18:49
Subsystem: the rest · Maintainer: Linus Torvalds

Use release_revisions() for the "struct rev_info" in
has_unstaged_changes() which didn't require the addition of a "goto"
pattern, but needed us to refactor another "return fn(...)" pattern.

This change is split from preceding changes to make similar
conversions in those commits easier to review, as they are all
repetitions of the same pattern.

Signed-off-by: Ævar Arnfjörð Bjarmason <redacted>
---
 wt-status.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/wt-status.c b/wt-status.c
index a68731ea0f7..89289e52603 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -2537,7 +2537,9 @@ int has_unstaged_changes(struct repository *r, int ignore_submodules)
 	rev_info.diffopt.flags.quick = 1;
 	diff_setup_done(&rev_info.diffopt);
 	result = run_diff_files(&rev_info, 0);
-	return diff_result_code(&rev_info.diffopt, result);
+	result = diff_result_code(&rev_info.diffopt, result);
+	release_revisions(&rev_info);
+	return result;
 }
 
 /**
-- 
2.35.1.1295.g6b025d3e231
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help