mirror of
https://github.com/flatpak/flatpak.git
synced 2026-04-16 13:00:48 -04:00
Delete some unreachable ref-not-found code
flatpak_remote_state_lookup_ref() always sets the error to
FLATPAK_ERROR_REF_NOT_FOUND when it returns FALSE.
Found by coverity CID 1514265
(cherry picked from commit 12ebf8fd9a)
This commit is contained in:
committed by
Phaedrus Leeds
parent
399710ada1
commit
bf9a72a3be
@@ -149,17 +149,11 @@ flatpak_builtin_remote_info (int argc, char **argv, GCancellable *cancellable, G
|
||||
{
|
||||
if (opt_commit)
|
||||
commit = g_strdup (opt_commit);
|
||||
else
|
||||
else if (!flatpak_remote_state_lookup_ref (state, flatpak_decomposed_get_ref (ref),
|
||||
&commit, NULL, NULL, NULL, error))
|
||||
{
|
||||
flatpak_remote_state_lookup_ref (state, flatpak_decomposed_get_ref (ref), &commit, NULL, NULL, NULL, error);
|
||||
if (commit == NULL)
|
||||
{
|
||||
if (error != NULL && *error == NULL)
|
||||
flatpak_fail_error (error, FLATPAK_ERROR_REF_NOT_FOUND,
|
||||
_("Couldn't find latest checksum for ref %s in remote %s"),
|
||||
flatpak_decomposed_get_ref (ref), remote);
|
||||
return FALSE;
|
||||
}
|
||||
g_assert (error == NULL || *error != NULL);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -5898,18 +5898,10 @@ flatpak_dir_pull (FlatpakDir *self,
|
||||
{
|
||||
rev = g_strdup (opt_rev);
|
||||
}
|
||||
else
|
||||
else if (!flatpak_remote_state_lookup_ref (state, ref, &rev, NULL, NULL, NULL, error))
|
||||
{
|
||||
flatpak_remote_state_lookup_ref (state, ref, &rev, NULL, NULL, NULL, error);
|
||||
if (rev == NULL && error != NULL && *error == NULL)
|
||||
flatpak_fail_error (error, FLATPAK_ERROR_REF_NOT_FOUND, _("Couldn't find latest checksum for ref %s in remote %s"),
|
||||
ref, state->remote_name);
|
||||
|
||||
if (rev == NULL)
|
||||
{
|
||||
g_assert (error == NULL || *error != NULL);
|
||||
return FALSE;
|
||||
}
|
||||
g_assert (error == NULL || *error != NULL);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
g_debug ("%s: Using commit %s for pull of ref %s from remote %s%s%s",
|
||||
|
||||
Reference in New Issue
Block a user