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

Unified Diff: go/src/infra/libs/git/child.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, 2 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « go/src/infra/libs/git/blob_test.go ('k') | go/src/infra/libs/git/child_test.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)
+}
« no previous file with comments | « go/src/infra/libs/git/blob_test.go ('k') | go/src/infra/libs/git/child_test.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698