| Index: go/src/infra/libs/git/child.go
|
| diff --git a/go/src/infra/libs/git/child.go b/go/src/infra/libs/git/child.go
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..e78560ee63aafa2d964bea347c24829083ca2fe4
|
| --- /dev/null
|
| +++ b/go/src/infra/libs/git/child.go
|
| @@ -0,0 +1,34 @@
|
| +// Copyright 2014 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +package git
|
| +
|
| +import (
|
| + "fmt"
|
| +)
|
| +
|
| +// Types ///////////////////////////////////////////////////////////////////////
|
| +
|
| +// Child is an entry in a Tree. It ties a Mode to an Object.
|
| +type Child struct {
|
| + Object Object
|
| + Mode Mode
|
| +}
|
| +
|
| +// Constructors ///////////////////////////////////////////////////////////////
|
| +
|
| +// NewEmptyChild returns a Child containing an EmptyObject of id.
|
| +func NewEmptyChild(mode Mode, id Identifiable) (*Child, error) {
|
| + o, err := NewEmptyObjectErr(mode.Type(), id)
|
| + if err != nil {
|
| + return nil, err
|
| + }
|
| + return &Child{o, mode}, nil
|
| +}
|
| +
|
| +// Member functions ////////////////////////////////////////////////////////////
|
| +
|
| +func (c Child) String() string {
|
| + return fmt.Sprintf("Child(%s, %s)", c.Object, c.Mode)
|
| +}
|
|
|