ostree-repo-refs: Drop unused function "parse_rev_file".
If it will be needed in future, it can be retrieved from the git history. Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
parent
150048f9b8
commit
bfd92653c3
|
|
@ -122,73 +122,6 @@ write_checksum_file (GFile *parentdir,
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static gboolean
|
|
||||||
parse_rev_file (OstreeRepo *self,
|
|
||||||
GFile *f,
|
|
||||||
char **sha256,
|
|
||||||
GError **error) G_GNUC_UNUSED;
|
|
||||||
|
|
||||||
static gboolean
|
|
||||||
parse_rev_file (OstreeRepo *self,
|
|
||||||
GFile *f,
|
|
||||||
char **sha256,
|
|
||||||
GError **error)
|
|
||||||
{
|
|
||||||
gboolean ret = FALSE;
|
|
||||||
GError *temp_error = NULL;
|
|
||||||
gs_free char *rev = NULL;
|
|
||||||
|
|
||||||
if ((rev = gs_file_load_contents_utf8 (f, NULL, &temp_error)) == NULL)
|
|
||||||
goto out;
|
|
||||||
|
|
||||||
if (rev == NULL)
|
|
||||||
{
|
|
||||||
if (g_error_matches (temp_error, G_FILE_ERROR, G_FILE_ERROR_NOENT))
|
|
||||||
{
|
|
||||||
g_clear_error (&temp_error);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
g_propagate_error (error, temp_error);
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
g_strchomp (rev);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (g_str_has_prefix (rev, "ref: "))
|
|
||||||
{
|
|
||||||
gs_unref_object GFile *ref = NULL;
|
|
||||||
char *ref_sha256;
|
|
||||||
gboolean subret;
|
|
||||||
|
|
||||||
ref = g_file_resolve_relative_path (self->local_heads_dir, rev + 5);
|
|
||||||
subret = parse_rev_file (self, ref, &ref_sha256, error);
|
|
||||||
|
|
||||||
if (!subret)
|
|
||||||
{
|
|
||||||
g_free (ref_sha256);
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
|
|
||||||
g_free (rev);
|
|
||||||
rev = ref_sha256;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (!ostree_validate_checksum_string (rev, error))
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
|
|
||||||
ot_transfer_out_value(sha256, &rev);
|
|
||||||
ret = TRUE;
|
|
||||||
out:
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
find_ref_in_remotes (OstreeRepo *self,
|
find_ref_in_remotes (OstreeRepo *self,
|
||||||
const char *rev,
|
const char *rev,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue