@@ -165,7 +165,7 @@ func (t *httpSmartSubtransport) Action(transportOptionsURL string, action git2go
165165 // Therefore, on the initial GET operation we update the target URL to include the
166166 // new target, so the subsequent actions include the correct target URL.
167167 // Example of this is trying to access a Git repository without the .git suffix.
168- if req .Response != nil && req . Response . StatusCode == http . StatusMovedPermanently {
168+ if req .Response != nil {
169169 if newURL , err := req .Response .Location (); err == nil && newURL != nil {
170170 if strings .EqualFold (newURL .Host , req .URL .Host ) && strings .EqualFold (newURL .Port (), req .URL .Port ()) {
171171 opts , _ := getTransportOptions (transportOptionsURL )
@@ -175,6 +175,9 @@ func (t *httpSmartSubtransport) Action(transportOptionsURL string, action git2go
175175
176176 opts .TargetURL = trimActionSuffix (newURL .String ())
177177 AddTransportOptions (transportOptionsURL , * opts )
178+
179+ debugLog .Info ("[http]: server responded with redirect" ,
180+ "newURL" , opts .TargetURL , "StatusCode" , req .Response .StatusCode )
178181 }
179182 }
180183 }
@@ -419,7 +422,6 @@ func (self *httpSmartSubtransportStream) sendRequest() error {
419422 return err
420423 }
421424
422- traceLog .Info ("[http]: POST redirect" , "URL" , self .req .URL )
423425 continue
424426 }
425427
@@ -435,7 +437,7 @@ func (self *httpSmartSubtransportStream) sendRequest() error {
435437 return err
436438 }
437439
438- return fmt .Errorf ("Unhandled HTTP error %s" , resp .Status )
440+ return fmt .Errorf ("unhandled HTTP error %s" , resp .Status )
439441 }
440442
441443 self .resp = resp
0 commit comments