aboutsummaryrefslogtreecommitdiffstats
path: root/file.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2016-08-30 15:29:31 +0200
committerMáximo Cuadros <mcuadros@gmail.com>2016-08-30 15:29:31 +0200
commit60636dd029a1e356bab8698b798504302fe645cb (patch)
tree49cfa335c09bb727d1954132075960562951a2aa /file.go
parent2c527d02ceac3879f82ab53645b6c7c03c0e5d71 (diff)
downloadgo-git-60636dd029a1e356bab8698b798504302fe645cb.tar.gz
DiffTree based on TreeWalker
Diffstat (limited to 'file.go')
-rw-r--r--file.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/file.go b/file.go
index e18caaf..9180528 100644
--- a/file.go
+++ b/file.go
@@ -16,7 +16,8 @@ type File struct {
Blob
}
-func newFile(name string, m os.FileMode, b *Blob) *File {
+// NewFile returns a File based on the given blob object
+func NewFile(name string, m os.FileMode, b *Blob) *File {
return &File{Name: name, Mode: m, Blob: *b}
}
@@ -77,7 +78,7 @@ func (iter *FileIter) Next() (*File, error) {
return nil, err
}
- return newFile(name, entry.Mode, blob), nil
+ return NewFile(name, entry.Mode, blob), nil
}
}