8000 Add comment about the use of --force · tonistiigi/buildkit@cd4a80c · GitHub
[go: up one dir, main page]

Skip to content

Commit cd4a80c

Browse files
committed
Add comment about the use of --force
Signed-off-by: Vlad A. Ionescu <vladaionescu@users.noreply.github.com>
1 parent 4ce2075 commit cd4a80c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

source/git/gitsource.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,8 @@ func (gs *gitSourceHandler) Snapshot(ctx context.Context) (out cache.ImmutableRe
273273
args = append(args, "origin")
274274
if !isCommitSHA(ref) {
275275
args = append(args, "--force", ref+":tags/"+ref)
276-
// local refs are needed so they would be advertised on next fetches
276+
// local refs are needed so they would be advertised on next fetches. Force is used
277+
// in case the ref is a branch and it now points to a different commit sha
277278
// TODO: is there a better way to do this?
278279
}
279280
if _, err := gitWithinDir(ctx, gitDir, "", args...); err != nil {

0 commit comments

Comments
 (0)
0