chiark / gitweb /
dgit: Move $data check into api_query
[dgit.git] / dgit
diff --git a/dgit b/dgit
index 80adf1fdbba1e9f10361aa0e4573b990f901c67b..ed6827bcacd52888083b1361f4653d16e5abe34b 100755 (executable)
--- 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);
 }