summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2019-07-23 15:27:51 +0100
committerIan Jackson <ijackson@chiark.greenend.org.uk>2019-07-23 15:31:13 +0100
commit49057372811e0d8f1f3cf856a3056dfe49e9139f (patch)
tree0bdf123a3214e11b5d0a0e1e7b3b6a882d01002d
parent9949ffa8a74cd5441b9566acabb935bc18d291da (diff)
dgit: Move $data check into api_query
In support of #932570. Our intended other caller doesn't have a $data. No functional change. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
-rwxr-xr-xdgit10
1 files changed, 5 insertions, 5 deletions
diff --git a/dgit b/dgit
index 80adf1f..ed6827b 100755
--- a/dgit
+++ b/dgit
@@ -1223,10 +1223,8 @@ sub archive_api_query_cmd ($) {
return @cmd;
}
-sub api_query_raw ($$;$) {
- my ($data, $subpath, $ok404) = @_;
- badcfg __ "ftpmasterapi archive query method takes no data part"
- if length $data;
+sub api_query_raw ($;$) {
+ my ($subpath, $ok404) = @_;
my @cmd = archive_api_query_cmd($subpath);
my $url = $cmd[$#cmd];
push @cmd, qw(-w %{http_code});
@@ -1245,7 +1243,9 @@ sub api_query_raw ($$;$) {
sub api_query ($$;$) {
my ($data, $subpath, $ok404) = @_;
use JSON;
- my $json = api_query_raw $data, $subpath, $ok404;
+ badcfg __ "ftpmasterapi archive query method takes no data part"
+ if length $data;
+ my $json = api_query_raw $subpath, $ok404;
return undef unless defined $json;
return decode_json($json);
}