Skip to content

Commit c0a6808

Browse files
committed
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.
1 parent 48a931c commit c0a6808

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

git/git.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,15 @@ const (
3838
RefBeforeFirstCommit = "4b825dc642cb6eb9a060e54bf8d69288fbee4904"
3939
)
4040

41+
type IndexStage int
42+
43+
const (
44+
IndexStageDefault IndexStage = iota
45+
IndexStageBase
46+
IndexStageOurs
47+
IndexStageTheirs
48+
)
49+
4150
// Prefix returns the given RefType's prefix, "refs/heads", "ref/remotes",
4251
// etc. It returns an additional value of either true/false, whether or not this
4352
// given ref type has a prefix.

0 commit comments

Comments
 (0)