mirror of
https://github.com/go-gitea/gitea.git
synced 2024-05-11 05:55:29 +00:00
* Fixes #2738 - /git/tags API * proper URLs * Adds function comments * Updates swagger * Removes newline from tag message * Removes trailing newline from commit message * Adds integration test * Removed debugging * Adds tests * Fixes bug where multiple tags of same commit show wrong tag name * Fix formatting * Removes unused varaible * Fix to annotated tag function names and response * Update modules/git/repo_tag.go Co-Authored-By: Lauris BH <lauris@nix.lv> * Uses TagPrefix * Changes per review, better error handling for getting tag and commit IDs * Fix to getting commit ID * Fix to getting commit ID * Fix to getting commit ID * Fix to getting commit ID
This commit is contained in:
@ -136,8 +136,8 @@ func TestAPIUpdateFile(t *testing.T) {
|
||||
var fileResponse api.FileResponse
|
||||
DecodeJSON(t, resp, &fileResponse)
|
||||
expectedSHA := "08bd14b2e2852529157324de9c226b3364e76136"
|
||||
expectedHTMLURL := fmt.Sprintf("http://localhost:"+setting.HTTPPort+"/user2/repo1/blob/new_branch/update/file%d.txt", fileID)
|
||||
expectedDownloadURL := fmt.Sprintf("http://localhost:"+setting.HTTPPort+"/user2/repo1/raw/branch/new_branch/update/file%d.txt", fileID)
|
||||
expectedHTMLURL := fmt.Sprintf(setting.AppURL+"user2/repo1/blob/new_branch/update/file%d.txt", fileID)
|
||||
expectedDownloadURL := fmt.Sprintf(setting.AppURL+"user2/repo1/raw/branch/new_branch/update/file%d.txt", fileID)
|
||||
assert.EqualValues(t, expectedSHA, fileResponse.Content.SHA)
|
||||
assert.EqualValues(t, expectedHTMLURL, fileResponse.Content.HTMLURL)
|
||||
assert.EqualValues(t, expectedDownloadURL, fileResponse.Content.DownloadURL)
|
||||
@ -155,8 +155,8 @@ func TestAPIUpdateFile(t *testing.T) {
|
||||
resp = session.MakeRequest(t, req, http.StatusOK)
|
||||
DecodeJSON(t, resp, &fileResponse)
|
||||
expectedSHA = "08bd14b2e2852529157324de9c226b3364e76136"
|
||||
expectedHTMLURL = fmt.Sprintf("http://localhost:"+setting.HTTPPort+"/user2/repo1/blob/master/rename/update/file%d.txt", fileID)
|
||||
expectedDownloadURL = fmt.Sprintf("http://localhost:"+setting.HTTPPort+"/user2/repo1/raw/branch/master/rename/update/file%d.txt", fileID)
|
||||
expectedHTMLURL = fmt.Sprintf(setting.AppURL+"user2/repo1/blob/master/rename/update/file%d.txt", fileID)
|
||||
expectedDownloadURL = fmt.Sprintf(setting.AppURL+"user2/repo1/raw/branch/master/rename/update/file%d.txt", fileID)
|
||||
assert.EqualValues(t, expectedSHA, fileResponse.Content.SHA)
|
||||
assert.EqualValues(t, expectedHTMLURL, fileResponse.Content.HTMLURL)
|
||||
assert.EqualValues(t, expectedDownloadURL, fileResponse.Content.DownloadURL)
|
||||
|
Reference in New Issue
Block a user