This repository has been archived by the owner on Apr 12, 2019. It is now read-only.
forked from gogs/git-module
-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fbe468c
commit 0aea7f1
Showing
2 changed files
with
29 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Copyright 2019 The Gitea Authors. All rights reserved. | ||
// Use of this source code is governed by a MIT-style | ||
// license that can be found in the LICENSE file. | ||
|
||
package git | ||
|
||
import ( | ||
"path/filepath" | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestRepository_GetTags(t *testing.T) { | ||
bareRepo1Path := filepath.Join(testReposDir, "repo1_bare") | ||
bareRepo1, err := OpenRepository(bareRepo1Path) | ||
assert.NoError(t, err) | ||
|
||
tags, err := bareRepo1.GetTagInfos() | ||
assert.NoError(t, err) | ||
assert.Len(t, tags, 1) | ||
assert.EqualValues(t, "test", tags[0].Name) | ||
assert.EqualValues(t, "3ad28a9149a2864384548f3d17ed7f38014c9e8a", tags[0].ID.String()) | ||
assert.EqualValues(t, "commit", tags[0].Type) | ||
} |