Unverified Commit 28dbe846 authored by Tomasz Maczukin's avatar Tomasz Maczukin
Browse files

Use tracker.actionable while checking directories on archiving

parent a89fd71d
......@@ -45,11 +45,3 @@ func printGitArchiveWarning(operation string) {
logrus.Warn(fmt.Sprintf("Part of .git directory is on the list of files to %s", operation))
logrus.Warn("This may introduce unexpected problems")
}
func warnOnGitDirectory(operation string, paths []string) {
if !doesPathsListContainGitDirectory(paths) {
return
}
printGitArchiveWarning(operation)
}
......@@ -83,12 +83,16 @@ func createZipEntry(archive *zip.Writer, fileName string) error {
}
func CreateZipArchive(w io.Writer, fileNames []string) error {
warnOnGitDirectory("archive", fileNames)
tracker := newPathErrorTracker()
archive := zip.NewWriter(w)
defer archive.Close()
for _, fileName := range fileNames {
if err := errorIfGitDirectory(fileName); tracker.actionable(err) {
printGitArchiveWarning("archive")
}
err := createZipEntry(archive, fileName)
if err != nil {
return err
......
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