Commit 525bd514 authored by Kamil Trzciński's avatar Kamil Trzciński

Fix tags handling when using git fetch: fetch all tags and prune the old ones

parent 17bc8edf
Pipeline #125276 passed with stage
......@@ -14,6 +14,7 @@ v 0.6.0 (unreleased)
- Pass container labels to docker
- WARNING: By default allow to override image and services
- Force to use go:1.4 for building packages
- Fix tags handling when using git fetch: fetch all tags and prune the old ones
v 0.5.5
- Fix cache_dir handling
......
......@@ -119,7 +119,7 @@ func (b *BashShell) writeFetchCmd(w io.Writer, build *common.Build, projectDir s
io.WriteString(w, fmt.Sprintf("git clean -fdx\n"))
io.WriteString(w, fmt.Sprintf("git reset --hard > /dev/null\n"))
io.WriteString(w, fmt.Sprintf("git remote set-url origin %s\n", helpers.ShellEscape(build.RepoURL)))
io.WriteString(w, fmt.Sprintf("git fetch origin\n"))
io.WriteString(w, fmt.Sprintf("git fetch origin --tags -p\n"))
io.WriteString(w, fmt.Sprintf("else\n"))
b.writeCloneCmd(w, build, projectDir)
io.WriteString(w, fmt.Sprintf("fi\n"))
......
......@@ -43,7 +43,7 @@ func (b *CmdShell) writeFetchCmd(w io.Writer, build *common.Build, dir string) {
b.writeCommandChecked(w, "git clean -fdx")
b.writeCommandChecked(w, "git reset --hard > NUL")
b.writeCommandChecked(w, "git remote set-url origin \"%s\"", build.RepoURL)
b.writeCommandChecked(w, "git fetch origin")
b.writeCommandChecked(w, "git fetch origin --tags -p")
b.writeCommand(w, ") ELSE (")
b.writeCloneCmd(w, build, dir)
b.writeCommand(w, ")")
......
......@@ -48,7 +48,7 @@ func (b *PowerShell) writeFetchCmd(w io.Writer, build *common.Build, dir string)
b.writeCommandChecked(w, "git clean -fdx")
b.writeCommandChecked(w, "git reset --hard > $null")
b.writeCommandChecked(w, "git remote set-url origin \"%s\"", build.RepoURL)
b.writeCommandChecked(w, "git fetch origin")
b.writeCommandChecked(w, "git fetch origin --tags -p")
b.writeCommand(w, "} else {")
b.writeCloneCmd(w, build, dir)
b.writeCommand(w, "}")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment