summaryrefslogtreecommitdiff
path: root/fileactions.go
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2017-11-22 14:47:56 -0500
committerLuke Shumaker <lukeshu@lukeshu.com>2017-11-22 14:47:56 -0500
commitf13250e6a926640c4d0ee858f84fcf8036d612aa (patch)
treed50dceaca4c048f7efde241d1af85afccfe406b5 /fileactions.go
parentdb24f3cbd10603f852032a95b5983335b6b5aff2 (diff)
ahhh
Diffstat (limited to 'fileactions.go')
-rw-r--r--fileactions.go94
1 files changed, 0 insertions, 94 deletions
diff --git a/fileactions.go b/fileactions.go
deleted file mode 100644
index 910fe5a..0000000
--- a/fileactions.go
+++ /dev/null
@@ -1,94 +0,0 @@
-package libfastimport
-
-import (
- "git.lukeshu.com/go/libfastimport/textproto"
-)
-
-type FileAction interface {
- fiWriteFA(*textproto.FIWriter) error
-}
-
-type FileModify struct {
- Mode textproto.Mode
- Path textproto.Path
- DataRef string
-}
-
-func (o FileModify) fiWriteFA(fiw *textproto.FIWriter) error {
- return fiw.WriteLine("M", o.Mode, o.DataRef, o.Path)
-}
-
-type FileModifyInline struct {
- Mode textproto.Mode
- Path textproto.Path
- Data string
-}
-
-func (o FileModifyInline) fiWriteFA(fiw *textproto.FIWriter) error {
- ez := &ezfiw{fiw: fiw}
- ez.WriteLine("M", o.Mode, "inline", o.Path)
- ez.WriteData(o.Data)
- return ez.err
-}
-
-type FileDelete struct {
- Path textproto.Path
-}
-
-func (o FileDelete) fiWriteFA(fiw *textproto.FIWriter) error {
- return fiw.WriteLine("D", o.Path)
-}
-
-type FileCopy struct {
- Src textproto.Path
- Dst textproto.Path
-}
-
-func (o FileCopy) fiWriteFA(fiw *textproto.FIWriter) error {
- return fiw.WriteLine("C", o.Src, o.Dst)
-}
-
-type FileRename struct {
- Src string
- Dst string
-}
-
-func (o FileRename) fiWriteFA(fiw *textproto.FIWriter) error {
- return fiw.WriteLine("R", o.Src, o.Dst)
-}
-
-type FileDeleteAll struct{}
-
-func (o FileDeleteAll) fiWriteFA(fiw *textproto.FIWriter) error {
- return fiw.WriteLine("deleteall")
-}
-
-type NoteModify struct {
- CommitIsh string
- DataRef string
-}
-
-func (o NoteModify) fiWriteFA(fiw *textproto.FIWriter) error {
- return fiw.WriteLine("N", o.DataRef, o.CommitIsh)
-}
-
-type NoteModifyInline struct {
- CommitIsh string
- Data string
-}
-
-func (o NoteModifyInline) fiWriteFA(fiw *textproto.FIWriter) error {
- ez := &ezfiw{fiw: fiw}
- ez.WriteLine("N", "inline", o.CommitIsh)
- ez.WriteData(o.Data)
- return ez.err
-}
-
-// See CmdLs for using ls outside of a commit
-type FileLs struct {
- Path textproto.Path
-}
-
-func (o FileLs) fiWriteFA(fiw *textproto.FIWriter) error {
- return fiw.WriteLine("ls", o.Path)
-}