@@ -24,7 +24,6 @@ declare function github:clone($config as map(*), $collection as xs:string, $sha
2424 "message" : concat ($config?vcs, " error: " , github:request ($url, $config?token)[1 ]/xs:string (@message))
2525 } )
2626 else (
27- if (github:available-sha ($config, $sha)) then (
2827 let $request := github:request ($url, $config?token)
2928 let $filter := app:unzip-filter#3
3029 let $unzip-action := app:unzip-store#4
@@ -35,18 +34,13 @@ declare function github:clone($config as map(*), $collection as xs:string, $sha
3534 xmldb:remove ($collection)
3635 else ()
3736 let $create-collection := xmldb:create-collection ("/" , $collection)
38- let $wirte-sha := app:write-sha ($collection,$sha)
37+ let $write-sha := app:write-sha ($collection, github:get-lastcommit-sha ($config)?sha)
38+
3939 let $clone := compression:unzip ($request[2 ], $filter, $filter-params, $unzip-action, $data-params)
4040 return map {
4141 "message" : "Success"
4242 }
4343 )
44- else (
45- map {
46- "message" : "REF not exist"
47- }
48- )
49- )
5044 }
5145 catch * {
5246 map {
@@ -102,7 +96,7 @@ declare function github:get-commits($config as map(*), $count as xs:int) {
10296 : Get all commits in full sha lenght
10397 :)
10498declare function github:get-commits-fullsha ($config as map (*)) {
105- let $url := $config?baseurl || "/repos/" || $config?owner || "/" || $config?repo || "/commits?sha=" || $config?refss
99+ let $url := $config?baseurl || "/repos/" || $config?owner || "/" || $config?repo || "/commits?sha=" || $config?ref
106100 let $request :=
107101 parse-json (util:base64-decode (github:request ($url, $config?token)[2 ]))
108102
0 commit comments