pull-local: Support --remote argument
For offline upgrades, pull-local can now write the refs into a specific remote, rather than using the local heads.
This commit is contained in:
parent
1ba852ebaa
commit
a167bb7342
|
|
@ -28,7 +28,10 @@
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
static char *opt_remote;
|
||||||
|
|
||||||
static GOptionEntry options[] = {
|
static GOptionEntry options[] = {
|
||||||
|
{ "remote", 0, 0, G_OPTION_ARG_STRING, &opt_remote, "Add REMOTE to refspec", "REMOTE" },
|
||||||
{ NULL }
|
{ NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -310,8 +313,9 @@ ostree_builtin_pull_local (int argc, char **argv, GFile *repo_path, GError **err
|
||||||
{
|
{
|
||||||
const char *name = key;
|
const char *name = key;
|
||||||
const char *checksum = value;
|
const char *checksum = value;
|
||||||
|
|
||||||
if (!ostree_repo_write_ref (data->dest_repo, NULL, name, checksum, error))
|
if (!ostree_repo_write_ref (data->dest_repo, opt_remote, name, checksum,
|
||||||
|
error))
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
echo "1..30"
|
echo "1..31"
|
||||||
|
|
||||||
. $(dirname $0)/libtest.sh
|
. $(dirname $0)/libtest.sh
|
||||||
|
|
||||||
|
|
@ -218,3 +218,11 @@ echo "ok subdir enoent"
|
||||||
cd ${test_tmpdir}
|
cd ${test_tmpdir}
|
||||||
$OSTREE checkout test2 --allow-noent --subpath /enoent 2>/dev/null
|
$OSTREE checkout test2 --allow-noent --subpath /enoent 2>/dev/null
|
||||||
echo "ok subdir noent"
|
echo "ok subdir noent"
|
||||||
|
|
||||||
|
cd ${test_tmpdir}
|
||||||
|
mkdir repo3
|
||||||
|
${CMD_PREFIX} ostree --repo=repo3 init
|
||||||
|
${CMD_PREFIX} ostree --repo=repo3 pull-local --remote=aremote repo test2
|
||||||
|
ostree --repo=repo3 rev-parse aremote/test2
|
||||||
|
echo "ok pull-local with --remote arg"
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue