Skip to content
This repository has been archived by the owner on Sep 11, 2020. It is now read-only.

Commit

Permalink
go fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
Dj Gilcrease committed Nov 15, 2019
1 parent fa19052 commit 95f48f3
Show file tree
Hide file tree
Showing 18 changed files with 1,286 additions and 1,288 deletions.
10 changes: 5 additions & 5 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ type Config struct {
// Branches list of branches, the key is the branch name and should
// equal Branch.Name
Branches map[string]*Branch
User *User
User *User
// Raw contains the raw information of a config file. The main goal is
// preserve the parsed information from the original format, to avoid
// dropping unsupported fields.
Expand All @@ -75,7 +75,7 @@ func NewConfig() *Config {
Remotes: make(map[string]*RemoteConfig),
Submodules: make(map[string]*Submodule),
Branches: make(map[string]*Branch),
User: new(User),
User: new(User),
Raw: format.New(),
}

Expand Down Expand Up @@ -123,9 +123,9 @@ const (
windowKey = "window"
mergeKey = "merge"
rebaseKey = "rebase"
userSection = "user"
nameKey = "name"
emailKey = "email"
userSection = "user"
nameKey = "name"
emailKey = "email"

// DefaultPackWindow holds the number of previous objects used to
// generate deltas. The value 10 is the same used by git command.
Expand Down
2 changes: 1 addition & 1 deletion config/user.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package config

type User struct {
Name string
Name string
Email string
}
16 changes: 8 additions & 8 deletions internal/revision/parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ func (s *ParserSuite) TestParseWithValidExpression(c *C) {
TildePath{3},
},
"@{2016-12-16T21:42:47Z}": []Revisioner{AtDate{tim}},
"@{1}": []Revisioner{AtReflog{1}},
"@{-1}": []Revisioner{AtCheckout{1}},
"@{1}": []Revisioner{AtReflog{1}},
"@{-1}": []Revisioner{AtCheckout{1}},
"master@{upstream}": []Revisioner{
Ref("master"),
AtUpstream{},
Expand Down Expand Up @@ -211,12 +211,12 @@ func (s *ParserSuite) TestParseAtWithValidExpression(c *C) {
tim, _ := time.Parse("2006-01-02T15:04:05Z", "2016-12-16T21:42:47Z")

datas := map[string]Revisioner{
"": Ref("HEAD"),
"{1}": AtReflog{1},
"{-1}": AtCheckout{1},
"{push}": AtPush{},
"{upstream}": AtUpstream{},
"{u}": AtUpstream{},
"": Ref("HEAD"),
"{1}": AtReflog{1},
"{-1}": AtCheckout{1},
"{push}": AtPush{},
"{upstream}": AtUpstream{},
"{u}": AtUpstream{},
"{2016-12-16T21:42:47Z}": AtDate{tim},
}

Expand Down
70 changes: 35 additions & 35 deletions plumbing/format/commitgraph/commitgraph.go
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
package commitgraph

import (
"time"

"gopkg.in/src-d/go-git.v4/plumbing"
)

// CommitData is a reduced representation of Commit as presented in the commit graph
// file. It is merely useful as an optimization for walking the commit graphs.
type CommitData struct {
// TreeHash is the hash of the root tree of the commit.
TreeHash plumbing.Hash
// ParentIndexes are the indexes of the parent commits of the commit.
ParentIndexes []int
// ParentHashes are the hashes of the parent commits of the commit.
ParentHashes []plumbing.Hash
// Generation number is the pre-computed generation in the commit graph
// or zero if not available
Generation int
// When is the timestamp of the commit.
When time.Time
}

// Index represents a representation of commit graph that allows indexed
// access to the nodes using commit object hash
type Index interface {
// GetIndexByHash gets the index in the commit graph from commit hash, if available
GetIndexByHash(h plumbing.Hash) (int, error)
// GetNodeByIndex gets the commit node from the commit graph using index
// obtained from child node, if available
GetCommitDataByIndex(i int) (*CommitData, error)
// Hashes returns all the hashes that are available in the index
Hashes() []plumbing.Hash
}
package commitgraph

import (
"time"

"gopkg.in/src-d/go-git.v4/plumbing"
)

// CommitData is a reduced representation of Commit as presented in the commit graph
// file. It is merely useful as an optimization for walking the commit graphs.
type CommitData struct {
// TreeHash is the hash of the root tree of the commit.
TreeHash plumbing.Hash
// ParentIndexes are the indexes of the parent commits of the commit.
ParentIndexes []int
// ParentHashes are the hashes of the parent commits of the commit.
ParentHashes []plumbing.Hash
// Generation number is the pre-computed generation in the commit graph
// or zero if not available
Generation int
// When is the timestamp of the commit.
When time.Time
}

// Index represents a representation of commit graph that allows indexed
// access to the nodes using commit object hash
type Index interface {
// GetIndexByHash gets the index in the commit graph from commit hash, if available
GetIndexByHash(h plumbing.Hash) (int, error)
// GetNodeByIndex gets the commit node from the commit graph using index
// obtained from child node, if available
GetCommitDataByIndex(i int) (*CommitData, error)
// Hashes returns all the hashes that are available in the index
Hashes() []plumbing.Hash
}
Loading

0 comments on commit 95f48f3

Please sign in to comment.