diff options
author | zeripath <art27@cantab.net> | 2019-08-05 21:39:39 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-05 21:39:39 +0100 |
commit | 7ad67109d732bd560c8da0356aa555be467d786c (patch) | |
tree | 7c7a35761b01e2eec6a823f0caf40748c3b7f327 /modules/git/repo_tag.go | |
parent | 1d8915ad5d9889c02dd98ab2c2f29aa8f5ee4dfa (diff) | |
download | gitea-7ad67109d732bd560c8da0356aa555be467d786c.tar.gz gitea-7ad67109d732bd560c8da0356aa555be467d786c.zip |
Be more strict with git arguments (#7715)
* Be more strict with git arguments
* fix-up commit test
* use bindings for branch name
Diffstat (limited to 'modules/git/repo_tag.go')
-rw-r--r-- | modules/git/repo_tag.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/git/repo_tag.go b/modules/git/repo_tag.go index 6d490af9b5..20c36bd708 100644 --- a/modules/git/repo_tag.go +++ b/modules/git/repo_tag.go @@ -29,13 +29,13 @@ func (repo *Repository) IsTagExist(name string) bool { // CreateTag create one tag in the repository func (repo *Repository) CreateTag(name, revision string) error { - _, err := NewCommand("tag", name, revision).RunInDir(repo.Path) + _, err := NewCommand("tag", "--", name, revision).RunInDir(repo.Path) return err } // CreateAnnotatedTag create one annotated tag in the repository func (repo *Repository) CreateAnnotatedTag(name, message, revision string) error { - _, err := NewCommand("tag", "-a", "-m", message, name, revision).RunInDir(repo.Path) + _, err := NewCommand("tag", "-a", "-m", message, "--", name, revision).RunInDir(repo.Path) return err } @@ -153,7 +153,7 @@ func (repo *Repository) GetTagNameBySHA(sha string) (string, error) { // GetTagID returns the object ID for a tag (annotated tags have both an object SHA AND a commit SHA) func (repo *Repository) GetTagID(name string) (string, error) { - stdout, err := NewCommand("show-ref", name).RunInDir(repo.Path) + stdout, err := NewCommand("show-ref", "--", name).RunInDir(repo.Path) if err != nil { return "", err } |