diff options
author | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | 2022-04-13 22:01:40 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-04-13 23:56:09 -0700 |
commit | 0139c58ab951e8620d6066eb687d0a96e490436a (patch) | |
tree | bdf014371e9a7407c94c695e1d224eea4eda8d66 /builtin/diff-files.c | |
parent | 5e480176fed01aeb47735f525002203ac6e462d0 (diff) | |
download | git-0139c58ab951e8620d6066eb687d0a96e490436a.tar.gz |
revisions API users: add "goto cleanup" for release_revisions()
Add a release_revisions() to various users of "struct rev_info" which
requires a minor refactoring to a "goto cleanup" pattern to use that
function.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/diff-files.c')
-rw-r--r-- | builtin/diff-files.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/builtin/diff-files.c b/builtin/diff-files.c index 70103c4095..2bfaf9ba7a 100644 --- a/builtin/diff-files.c +++ b/builtin/diff-files.c @@ -77,8 +77,12 @@ int cmd_diff_files(int argc, const char **argv, const char *prefix) if (read_cache_preload(&rev.diffopt.pathspec) < 0) { perror("read_cache_preload"); - return -1; + result = -1; + goto cleanup; } +cleanup: result = run_diff_files(&rev, options); - return diff_result_code(&rev.diffopt, result); + result = diff_result_code(&rev.diffopt, result); + release_revisions(&rev); + return result; } |