diff options
author | zeripath <art27@cantab.net> | 2022-08-23 19:12:43 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-23 14:12:43 -0400 |
commit | aa2e47399158ea5958638f5bb5f89967054bf48e (patch) | |
tree | 5d5a24300481765a4318d47e703395a7ad2a4bde /modules | |
parent | 3d870f6dde9fa688a04d20150d224c4eb8c3f961 (diff) | |
download | gitea-aa2e47399158ea5958638f5bb5f89967054bf48e.tar.gz gitea-aa2e47399158ea5958638f5bb5f89967054bf48e.zip |
Set no-tags in git fetch on compare (#20893)
* Set no-tags in git fetch on compare
In the compare endpoint the git fetch is restricted to a certain branch however,
this does not completely prevent tag acquisition/pollution as git fetch will collect
any tags on that branch.
This causes pollution of the tag namespace and could cause confusion by users.
This PR adds `--no-tags` to the `git fetch` call.
Signed-off-by: Andrew Thornton <art27@cantab.net>
* Update modules/git/repo_compare.go
* Update modules/git/repo_compare.go
Signed-off-by: Andrew Thornton <art27@cantab.net>
Diffstat (limited to 'modules')
-rw-r--r-- | modules/git/repo_compare.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/git/repo_compare.go b/modules/git/repo_compare.go index 577c9f475e..589a7eae00 100644 --- a/modules/git/repo_compare.go +++ b/modules/git/repo_compare.go @@ -40,7 +40,7 @@ func (repo *Repository) GetMergeBase(tmpRemote, base, head string) (string, stri if tmpRemote != "origin" { tmpBaseName := RemotePrefix + tmpRemote + "/tmp_" + base // Fetch commit into a temporary branch in order to be able to handle commits and tags - _, _, err := NewCommand(repo.Ctx, "fetch", tmpRemote, base+":"+tmpBaseName).RunStdString(&RunOpts{Dir: repo.Path}) + _, _, err := NewCommand(repo.Ctx, "fetch", "--no-tags", tmpRemote, "--", base+":"+tmpBaseName).RunStdString(&RunOpts{Dir: repo.Path}) if err == nil { base = tmpBaseName } |