@@ -3,7 +3,6 @@ Class SourceControl.Git.WebUIDriver
3
3
4
4
ClassMethod HandleRequest (pagePath As %String , InternalName As %String = " " , Output handled As %Boolean = 0 , Output %data As %Stream .Object )
5
5
{
6
- do %session .Unlock ()
7
6
// Make sure we capture any stray output
8
7
set buffer = ##class (SourceControl.Git.Util.Buffer ).%New ()
9
8
do buffer .BeginCaptureOutput ()
@@ -13,6 +12,7 @@ ClassMethod HandleRequest(pagePath As %String, InternalName As %String = "", Out
13
12
#dim %request as %CSP.Request
14
13
set pathStart = $piece (pagePath ," /" ,2 )
15
14
if pathStart = " api" {
15
+ do %session .Unlock ()
16
16
set handled = 1
17
17
set %data = ##class (%Stream.FileCharacter ).%New ()
18
18
if $extract (pagePath ,6 ,*) = " userinfo" {
@@ -42,6 +42,7 @@ ClassMethod HandleRequest(pagePath As %String, InternalName As %String = "", Out
42
42
SimpleHTTPRequestHandler.do_GET(self)
43
43
*/
44
44
if (pathStart = " git" ) {
45
+ do %session .Unlock ()
45
46
if $piece (pagePath ," /" ,3 ) = " cat-file" {
46
47
set blob = $piece (pagePath ," /" ,4 )
47
48
set name = $Piece (pagePath ," /" ,*)
@@ -107,6 +108,10 @@ ClassMethod HandleRequest(pagePath As %String, InternalName As %String = "", Out
107
108
}
108
109
set readOnlyCommands = $listbuild (" branch" ," tag" ," log" ," ls-files" ," ls-tree" ," show" ," status" ," diff" )
109
110
set baseCommand = $Piece (args (1 )," " )
111
+
112
+ if '$listfind (readOnlyCommands ,baseCommand ) {
113
+ do %session .Unlock ()
114
+ }
110
115
111
116
set gitArgs ($increment (gitArgs )) = " color.ui=true"
112
117
0 commit comments