From 940a16ca68457beded1eff551f23febeffb32f3e Mon Sep 17 00:00:00 2001 From: Máximo Cuadros Date: Mon, 13 Feb 2017 19:18:05 +0100 Subject: format/index: sort the Entries before encode --- plumbing/format/index/index.go | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'plumbing/format/index/index.go') diff --git a/plumbing/format/index/index.go b/plumbing/format/index/index.go index e5dc178..a95dba2 100644 --- a/plumbing/format/index/index.go +++ b/plumbing/format/index/index.go @@ -36,9 +36,14 @@ const ( // in the worktree, having information about the working files. Changes in // worktree are detected using this Index. The Index is also used during merges type Index struct { - Version uint32 - Entries []Entry - Cache *Tree + // Version is index version + Version uint32 + // Entries collection of entries represented by this Index. The order of + // this collection is not guaranteed + Entries []Entry + // Cache represents the 'Cached tree' extension + Cache *Tree + // ResolveUndo represents the 'Resolve undo' extension ResolveUndo *ResolveUndo } @@ -84,7 +89,7 @@ type TreeEntry struct { // Path component (relative to its parent directory) Path string // Entries is the number of entries in the index that is covered by the tree - // this entry represents + // this entry represents. Entries int // Trees is the number that represents the number of subtrees this tree has Trees int -- cgit