Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(320)

Side by Side Diff: go/src/infra/libs/git/treeDiff.go

Issue 662113003: Drover's back, baby! (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git/+/master
Patch Set: more tests and refactors Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « go/src/infra/libs/git/tree.go ('k') | go/src/infra/libs/git/tree_test.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 package git
6
7 import (
8 "fmt"
9 )
10
11 // Types ///////////////////////////////////////////////////////////////////////
12
13 // TreeDiff represents the difference between two Treeish objects
14 type TreeDiff []TreeDiffEntry
15
16 // TreeDiffEntry represents the before and after of one path in the repo.
17 // Note that the Old.Name and New.Name may be different if this item was
18 // Moved or Copied.
19 type TreeDiffEntry struct {
20 // Action is one of "ACDMRTUX"
21 // U is for unmerged... if you're just comparing trees you should never see this
22 // X is probably a bug in git... you should also never see this.
23 // T is a type change, so if a tree turned into a blob, for example
24 Action string
25
26 // For Action types 'R' or 'C', what percentage (from 0-100) are the old and
27 // new blobs similar.
28 Similarity int
29
30 Old TreeDiffEntryHalf
31 New TreeDiffEntryHalf
32 }
33
34 // TreeDiffEntryHalf is one entry in a TreeDiffEntry, either the Old or New half .
35 type TreeDiffEntryHalf struct {
36 Child
37 Name string
38 }
39
40 // Member functions ////////////////////////////////////////////////////////////
41
42 func (t *TreeDiffEntryHalf) String() string {
43 return fmt.Sprintf("%s: %s", t.Name, t.Child)
44 }
OLDNEW
« no previous file with comments | « go/src/infra/libs/git/tree.go ('k') | go/src/infra/libs/git/tree_test.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698