| OLD | NEW |
| (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 } |
| OLD | NEW |