aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOri Rawlings <orirawlings@gmail.com>2017-12-17 20:26:53 -0600
committerGitHub <noreply@github.com>2017-12-17 20:26:53 -0600
commitfbe632ef8d41c17caa76b6ed3f1d404e1f047299 (patch)
tree91c31e3e9978143f19087591c453a5d4f6781365
parent757a26038e5404f94523ba07d017d1b38bcbf6dd (diff)
parent9a9f35269c31e880bc88486a5bcc13f592eace6a (diff)
downloadgo-git-fbe632ef8d41c17caa76b6ed3f1d404e1f047299.tar.gz
Merge pull request #696 from ferhatelmas/simplify-again
*: simplication
-rw-r--r--object_walker.go5
-rw-r--r--storage/filesystem/internal/dotgit/dotgit.go6
-rw-r--r--worktree_test.go4
3 files changed, 4 insertions, 11 deletions
diff --git a/object_walker.go b/object_walker.go
index 8bae1fa..4cbbcca 100644
--- a/object_walker.go
+++ b/object_walker.go
@@ -36,10 +36,7 @@ func (p *objectWalker) walkAllRefs() error {
}
return p.walkObjectTree(ref.Hash())
})
- if err != nil {
- return err
- }
- return nil
+ return err
}
func (p *objectWalker) isSeen(hash plumbing.Hash) bool {
diff --git a/storage/filesystem/internal/dotgit/dotgit.go b/storage/filesystem/internal/dotgit/dotgit.go
index ebc6bad..d644810 100644
--- a/storage/filesystem/internal/dotgit/dotgit.go
+++ b/storage/filesystem/internal/dotgit/dotgit.go
@@ -212,11 +212,7 @@ func (d *DotGit) DeleteOldObjectPackAndIndex(hash plumbing.Hash, t time.Time) er
if err != nil {
return err
}
- err = d.fs.Remove(d.objectPackPath(hash, `idx`))
- if err != nil {
- return err
- }
- return nil
+ return d.fs.Remove(d.objectPackPath(hash, `idx`))
}
// NewObject return a writer for a new object file.
diff --git a/worktree_test.go b/worktree_test.go
index 36e3a08..ee9bf2f 100644
--- a/worktree_test.go
+++ b/worktree_test.go
@@ -1481,7 +1481,7 @@ func (s *WorktreeSuite) TestGrep(c *C) {
break
}
}
- if found != true {
+ if !found {
c.Errorf("unexpected grep results for %q, expected result to contain: %v", tc.name, wantResult)
}
}
@@ -1496,7 +1496,7 @@ func (s *WorktreeSuite) TestGrep(c *C) {
break
}
}
- if found != false {
+ if found {
c.Errorf("unexpected grep results for %q, expected result to NOT contain: %v", tc.name, dontWantResult)
}
}