Debian Codegraph @

plumbing/format/config/format.go

raw
1 package config
2
3 // RepositoryFormatVersion represents the repository format version,
4 // as per defined at:
5 //
6 // https://git-scm.com/docs/repository-version
7 type RepositoryFormatVersion string
8
9 const (
10 // Version_0 is the format defined by the initial version of git,
11 // including but not limited to the format of the repository
12 // directory, the repository configuration file, and the object
13 // and ref storage.
14 //
15 // Specifying the complete behavior of git is beyond the scope
16 // of this document.
17 Version_0 = "0"
18
19 // Version_1 is identical to version 0, with the following exceptions:
20 //
21 // 1. When reading the core.repositoryformatversion variable, a git
22 // implementation which supports version 1 MUST also read any
23 // configuration keys found in the extensions section of the
24 // configuration file.
25 //
26 // 2. If a version-1 repository specifies any extensions.* keys that
27 // the running git has not implemented, the operation MUST NOT proceed.
28 // Similarly, if the value of any known key is not understood by the
29 // implementation, the operation MUST NOT proceed.
30 //
31 // Note that if no extensions are specified in the config file, then
32 // core.repositoryformatversion SHOULD be set to 0 (setting it to 1 provides
33 // no benefit, and makes the repository incompatible with older
34 // implementations of git).
35 Version_1 = "1"
36
37 // DefaultRepositoryFormatVersion holds the default repository format version.
38 DefaultRepositoryFormatVersion = Version_0
39 )
40
41 // ObjectFormat defines the object format.
42 type ObjectFormat string
43
44 const (
45 // SHA1 represents the object format used for SHA1.
46 SHA1 ObjectFormat = "sha1"
47
48 // SHA256 represents the object format used for SHA256.
49 SHA256 ObjectFormat = "sha256"
50
51 // DefaultObjectFormat holds the default object format.
52 DefaultObjectFormat = SHA1
53 )