git: introduce constants for index stages

Git can store multiple different versions of a file in the index.
Normally, index stage 0 is the only version provided, but if there's a
conflict, there can be three additional stages.  Since we'll be working
with these stages in a future commit, add constants for them to the git
package.
This commit is contained in:
brian m. carlson 2018-10-02 13:53:59 +00:00
parent 48a931cc86
commit c0a68086e9
No known key found for this signature in database
GPG Key ID: 2D0C9BC12F82B3A1

@ -38,6 +38,15 @@ const (
RefBeforeFirstCommit = "4b825dc642cb6eb9a060e54bf8d69288fbee4904" RefBeforeFirstCommit = "4b825dc642cb6eb9a060e54bf8d69288fbee4904"
) )
type IndexStage int
const (
IndexStageDefault IndexStage = iota
IndexStageBase
IndexStageOurs
IndexStageTheirs
)
// Prefix returns the given RefType's prefix, "refs/heads", "ref/remotes", // Prefix returns the given RefType's prefix, "refs/heads", "ref/remotes",
// etc. It returns an additional value of either true/false, whether or not this // etc. It returns an additional value of either true/false, whether or not this
// given ref type has a prefix. // given ref type has a prefix.