return @cmd;
}
-sub api_query ($$;$) {
- use JSON;
+sub api_query_raw ($$;$) {
my ($data, $subpath, $ok404) = @_;
badcfg __ "ftpmasterapi archive query method takes no data part"
if length $data;
return undef if $code eq '404' && $ok404;
fail f_ "fetch of %s gave HTTP code %s", $url, $code
unless $url =~ m#^file://# or $code =~ m/^2/;
+ return $json;
+}
+
+sub api_query ($$;$) {
+ my ($data, $subpath, $ok404) = @_;
+ use JSON;
+ my $json = api_query_raw $data, $subpath, $ok404;
+ return undef unless defined $json;
return decode_json($json);
}
record_maindir();
setup_new_tree();
clone_set_head();
- my $giturl = access_giturl(1);
- if (defined $giturl) {
- runcmd @git, qw(remote add), 'origin', $giturl;
- }
if ($hasgit) {
progress __ "fetching existing git history";
git_fetch_us();
- runcmd_ordryrun_local @git, qw(fetch origin);
} else {
progress __ "starting new git history";
}