Skip to content

Commit f78bf3b

Browse files
committed
Minor code cleanup
1 parent 2a820b5 commit f78bf3b

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

git.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
"time"
1111
)
1212

13-
const _VERSION = "0.3.6"
13+
const _VERSION = "0.3.7"
1414

1515
func Version() string {
1616
return _VERSION

repo.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,10 @@ func OpenRepository(repoPath string) (*Repository, error) {
8181
}
8282

8383
type CloneRepoOptions struct {
84+
Timeout time.Duration
8485
Mirror bool
8586
Bare bool
8687
Quiet bool
87-
Timeout time.Duration
8888
Branch string
8989
}
9090

@@ -119,10 +119,10 @@ func Clone(from, to string, opts CloneRepoOptions) (err error) {
119119
}
120120

121121
type PullRemoteOptions struct {
122+
Timeout time.Duration
122123
All bool
123124
Remote string
124125
Branch string
125-
Timeout time.Duration
126126
}
127127

128128
// Pull pulls changes from remotes.
@@ -150,9 +150,9 @@ func Push(repoPath, remote, branch string) error {
150150
}
151151

152152
type CheckoutOptions struct {
153+
Timeout time.Duration
153154
Branch string
154155
OldBranch string
155-
Timeout time.Duration
156156
}
157157

158158
// Checkout checkouts a branch
@@ -188,8 +188,6 @@ func ResetHEAD(repoPath string, hard bool, revision string) error {
188188

189189
// MoveFile moves a file to another file or directory.
190190
func MoveFile(repoPath, oldTreeName, newTreeName string) error {
191-
cmd := NewCommand("mv")
192-
cmd.AddArguments(oldTreeName, newTreeName)
193-
_, err := cmd.RunInDir(repoPath)
191+
_, err := NewCommand("mv").AddArguments(oldTreeName, newTreeName).RunInDir(repoPath)
194192
return err
195193
}

0 commit comments

Comments
 (0)