@@ -89,25 +89,16 @@ ClassMethod HandleRequest(pagePath As %String, InternalName As %String = "", Out
8989 SimpleHTTPRequestHandler.do_POST(self)
9090 */
9191 if (pathStart = " git" ) {
92- set reference = " %request.Data"
93- for {
94- set reference = $query (@reference )
95- quit :reference =" "
96- if $qsubscript (reference ,3 )=" O" {
97- set args (@reference )=$qsubscript (reference ,1 )
98- if $data (%request .Data ($qsubscript (reference ,1 ),$qsubscript (reference ,2 )),argValue )#2 && (argValue '= " " ) {
99- set args (@reference )=args (@reference )_" =" _argValue
100- }
101- }
102- }
92+ merge data = %request .Data
93+ set args = data (" command" ,1 )
10394
10495 // Problem: args(1) might contain $c(10) followed by our stdin value
105- if $data (args ( 1 ) )#2 {
106- set stdin = $piece (args ( 1 ) ,$char (10 ),2 ,*)
107- set args ( 1 ) = $piece (args ( 1 ) ,$char (10 ))
96+ if $data (args )#2 {
97+ set stdin = $piece (args ,$char (10 ),2 ,*)
98+ set args = $piece (args ,$char (10 ))
10899 }
109100 set readOnlyCommands = $listbuild (" branch" ," tag" ," log" ," ls-files" ," ls-tree" ," show" ," status" ," diff" )
110- set baseCommand = $Piece (args ( 1 ) ," " )
101+ set baseCommand = $Piece (args ," " )
111102
112103 if $listfind (readOnlyCommands ,baseCommand ) {
113104 do %session .Unlock ()
@@ -117,7 +108,7 @@ ClassMethod HandleRequest(pagePath As %String, InternalName As %String = "", Out
117108
118109 // TODO: Don't be lazy! Implement shlex.split in ObjectScript.
119110 // The below is just a little bit cheesy.
120- set argList = $listfromstring (args ( 1 ) ," " )
111+ set argList = $listfromstring (args ," " )
121112 set pointer = 0
122113 set inQuotedString = 0
123114 while $listnext (argList ,pointer ,arg ) {
0 commit comments