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>
This commit is contained in:

committed by
Junio C Hamano

parent
5e480176fe
commit
0139c58ab9
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user