Skip to content

Commit 50fb811

Browse files
committed
Fix tests
The previous merge managed to break repo_form.go Signed-off-by: Andrew Thornton <[email protected]>
1 parent a12dd1d commit 50fb811

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

integrations/api_repo_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ func TestAPIRepoMigrate(t *testing.T) {
325325
if resp.Code == http.StatusUnprocessableEntity {
326326
respJSON := map[string]string{}
327327
DecodeJSON(t, resp, &respJSON)
328-
if assert.Equal(t, respJSON["message"], "Remote visit addressed rate limitation.") {
328+
if assert.Equal(t, "Remote visit addressed rate limitation.", respJSON["message"]) {
329329
t.Log("test hit github rate limitation")
330330
}
331331
} else {

modules/auth/repo_form.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -108,15 +108,15 @@ func ParseRemoteAddr(remoteAddr, authUsername, authPassword string, user *models
108108
}
109109
} else if !user.CanImportLocal() {
110110
return "", models.ErrInvalidCloneAddr{IsPermissionDenied: true}
111-
}
112-
113-
isDir, err := util.IsDir(remoteAddr)
114-
if err != nil {
115-
log.Error("Unable to check if %s is a directory: %v", remoteAddr, err)
116-
return "", err
117-
}
118-
if !isDir {
119-
return "", models.ErrInvalidCloneAddr{IsInvalidPath: true}
111+
} else {
112+
isDir, err := util.IsDir(remoteAddr)
113+
if err != nil {
114+
log.Error("Unable to check if %s is a directory: %v", remoteAddr, err)
115+
return "", err
116+
}
117+
if !isDir {
118+
return "", models.ErrInvalidCloneAddr{IsInvalidPath: true}
119+
}
120120
}
121121

122122
return remoteAddr, nil

0 commit comments

Comments
 (0)