aboutsummaryrefslogtreecommitdiffstats
path: root/repository.go
diff options
context:
space:
mode:
authorJavi Fontan <jfontan@gmail.com>2018-03-26 23:18:54 +0200
committerJavi Fontan <jfontan@gmail.com>2018-03-27 17:32:59 +0200
commit05c414a169a75ca933402e5be19a5c4304aa4f00 (patch)
tree19dcd85c5d221cf41fa06c200423d5cc236f9f31 /repository.go
parent160e6d5b654fbbaf0d9264f226c56a03f0e27d30 (diff)
downloadgo-git-05c414a169a75ca933402e5be19a5c4304aa4f00.tar.gz
*: Use CheckClose with named returns
Previously some close errors were losts. This is specially problematic in go-git as lots of work is done here like generating indexes and moving packfiles. Signed-off-by: Javi Fontan <jfontan@gmail.com>
Diffstat (limited to 'repository.go')
-rw-r--r--repository.go6
1 files changed, 2 insertions, 4 deletions
diff --git a/repository.go b/repository.go
index 98558d9..4ea51f5 100644
--- a/repository.go
+++ b/repository.go
@@ -270,9 +270,7 @@ func dotGitToOSFilesystems(path string) (dot, wt billy.Filesystem, err error) {
return dot, fs, nil
}
-func dotGitFileToOSFilesystem(path string, fs billy.Filesystem) (billy.Filesystem, error) {
- var err error
-
+func dotGitFileToOSFilesystem(path string, fs billy.Filesystem) (bfs billy.Filesystem, err error) {
f, err := fs.Open(".git")
if err != nil {
return nil, err
@@ -1092,7 +1090,7 @@ func (r *Repository) createNewObjectPack(cfg *RepackConfig) (h plumbing.Hash, er
if los, ok := r.Storer.(storer.LooseObjectStorer); ok {
err = los.ForEachObjectHash(func(hash plumbing.Hash) error {
if ow.isSeen(hash) {
- err := los.DeleteLooseObject(hash)
+ err = los.DeleteLooseObject(hash)
if err != nil {
return err
}