mirror of
https://github.com/go-gitea/gitea
synced 2025-07-13 22:17:20 +00:00
Clone repository with Tea CLI (#33725)
This PR adds "Tea CLI" as a clone method. <img width="350" alt="Capture d’écran 2025-02-25 à 23 38 47" src="https://github.com/user-attachments/assets/8e86e54a-998b-45d1-9f20-167b449e79b6" /> --------- Signed-off-by: Quentin Guidée <quentin.guidee@gmail.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
@ -130,8 +130,13 @@ func TestViewRepo1CloneLinkAnonymous(t *testing.T) {
|
||||
link, exists := htmlDoc.doc.Find(".repo-clone-https").Attr("data-link")
|
||||
assert.True(t, exists, "The template has changed")
|
||||
assert.Equal(t, setting.AppURL+"user2/repo1.git", link)
|
||||
|
||||
_, exists = htmlDoc.doc.Find(".repo-clone-ssh").Attr("data-link")
|
||||
assert.False(t, exists)
|
||||
|
||||
link, exists = htmlDoc.doc.Find(".repo-clone-tea").Attr("data-link")
|
||||
assert.True(t, exists, "The template has changed")
|
||||
assert.Equal(t, "tea clone user2/repo1", link)
|
||||
}
|
||||
|
||||
func TestViewRepo1CloneLinkAuthorized(t *testing.T) {
|
||||
@ -146,10 +151,15 @@ func TestViewRepo1CloneLinkAuthorized(t *testing.T) {
|
||||
link, exists := htmlDoc.doc.Find(".repo-clone-https").Attr("data-link")
|
||||
assert.True(t, exists, "The template has changed")
|
||||
assert.Equal(t, setting.AppURL+"user2/repo1.git", link)
|
||||
|
||||
link, exists = htmlDoc.doc.Find(".repo-clone-ssh").Attr("data-link")
|
||||
assert.True(t, exists, "The template has changed")
|
||||
sshURL := fmt.Sprintf("ssh://%s@%s:%d/user2/repo1.git", setting.SSH.User, setting.SSH.Domain, setting.SSH.Port)
|
||||
assert.Equal(t, sshURL, link)
|
||||
|
||||
link, exists = htmlDoc.doc.Find(".repo-clone-tea").Attr("data-link")
|
||||
assert.True(t, exists, "The template has changed")
|
||||
assert.Equal(t, "tea clone user2/repo1", link)
|
||||
}
|
||||
|
||||
func TestViewRepoWithSymlinks(t *testing.T) {
|
||||
|
Reference in New Issue
Block a user