From 4e4a7c9af58ed7058483fc2d8cd8bb792984799d Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Tue, 5 Dec 2017 12:12:05 +0000 Subject: [PATCH] git: Print details of ignored error when mirroring Rather than dropping the error on the floor entirely. Coverity CID: #208384 Signed-off-by: Philip Withnall Closes: #74 Approved by: alexlarsson --- src/builder-git.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/builder-git.c b/src/builder-git.c index 0579d180..b80bc202 100644 --- a/src/builder-git.c +++ b/src/builder-git.c @@ -586,12 +586,16 @@ builder_git_mirror_repo (const char *repo_location, if (alternates) { + g_autoptr(GError) local_error = NULL; + /* Ensure we copy the files from the cache, to be safe if the extra source changes */ if (!git (mirror_dir, NULL, 0, error, "repack", "-a", "-d", NULL)) return FALSE; - g_file_delete (alternates, NULL, NULL); + if (!g_file_delete (alternates, NULL, &local_error) && + !g_error_matches (local_error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND)) + g_debug ("Error deleting alternates file: %s", local_error->message); } }