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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <avarab@xxxxxxxxx>
---
 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




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux