mirror of
https://github.com/moby/buildkit.git
synced 2025-07-29 04:01:13 +03:00
git: fix pulling commit SHA only referenced from a tag
On commit SHA input we currently do a full fetch of remote so we can pick up the commit by SHA later. This only pulls in tags that are also part of branches. Extra flag is needed to also get the tags that are not part of branches. Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
@ -470,6 +470,7 @@ func (gs *gitSourceHandler) Snapshot(ctx context.Context, g session.Group) (out
|
||||
if !isCommitSHA(ref) { // TODO: find a branch from ls-remote?
|
||||
args = append(args, "--depth=1", "--no-tags")
|
||||
} else {
|
||||
args = append(args, "--tags")
|
||||
if _, err := os.Lstat(filepath.Join(gitDir, "shallow")); err == nil {
|
||||
args = append(args, "--unshallow")
|
||||
}
|
||||
|
Reference in New Issue
Block a user