git access: add proper cleanup function for git_info

We had various random "free parts of the git info" left-overs from when
we passed down the git repo data ad-hoc.  Get rid of it, and replace it
with just doing a 'cleanup_git_info()' that does the final cleanup of it
all.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Linus Torvalds 2022-04-18 14:36:00 -07:00 committed by Dirk Hohndel
parent 96337dbbcf
commit e33680c336
9 changed files with 28 additions and 15 deletions

View file

@ -1362,8 +1362,6 @@ int do_git_save(struct git_info *info, bool select_only, bool create_empty)
int git_save_dives(struct git_info *info, bool select_only)
{
int ret;
/*
* FIXME!! This open_git_repository() will
* sync with the cloud. That is NOT what
@ -1389,8 +1387,5 @@ int git_save_dives(struct git_info *info, bool select_only)
if (!open_git_repository(info))
report_error(translate("gettextFromC", "Failed to save dives to %s[%s] (%s)"), info->url, info->branch, strerror(errno));
ret = do_git_save(info, select_only, false);
git_repository_free(info->repo);
free((void *)info->branch);
return ret;
return do_git_save(info, select_only, false);
}