Welcome to mirror list, hosted at ThFree Co, Russian Federation.

flags_darwin.go « archive « internal - gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 7050d25120432a01a8c8316ef28acde92ffbcfcf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package archive

import (
	"gitlab.com/gitlab-org/gitaly/v16/internal/darwin"
)

// MacOS operating system of version lower than 13 produces extra files while creating a tarball archive.
// Then details can be found in the answer https://apple.stackexchange.com/a/76077.
// The extra flag '--no-mac-metadata' needs to be added to the tar command to overcome it.
// We can drop this hack once moved to a newer version of MacOS used in our 'test:macos' CI job.
// Also, the function 'generateTarFile()' in internal/gitaly/service/repository/create_repository_from_snapshot_test.go
// can be simplified after version upgrade.
func extraFlags() []string {
	if darwin.MajorVersion() < 13 {
		return []string{"--no-mac-metadata"}
	}

	return nil
}