Skip to content

Commit

Permalink
Merge pull request #2076 from flant/disable_git_reset_commit_env
Browse files Browse the repository at this point in the history
[stapel] DISABLE_GIT_ARCHIVE_RESET_COMMIT
  • Loading branch information
alexey-igrychev committed Jan 22, 2020
2 parents cf80c65 + 3bc177e commit c99ae51
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions pkg/build/stage/git_archive.go
Expand Up @@ -2,6 +2,7 @@ package stage

import (
"fmt"
"os"
"sort"

"github.com/flant/werf/pkg/image"
Expand Down Expand Up @@ -42,12 +43,14 @@ func (s *GitArchiveStage) GetDependencies(_ Conveyor, _, _ image.ImageInterface)
for _, gitMapping := range s.gitMappings {
args = append(args, gitMapping.GetParamshash())

commit, err := gitMapping.GitRepo().FindCommitIdByMessage(GitArchiveResetCommitRegex)
if err != nil {
return "", err
}
if os.Getenv("DISABLE_GIT_ARCHIVE_RESET_COMMIT") != "1" {
commit, err := gitMapping.GitRepo().FindCommitIdByMessage(GitArchiveResetCommitRegex)
if err != nil {
return "", err
}

args = append(args, commit)
args = append(args, commit)
}
}

sort.Strings(args)
Expand Down

0 comments on commit c99ae51

Please sign in to comment.