Skip to content
go-libfossil Artifact [3be586f6b3]
Login

Artifact [3be586f6b3]

Artifact 3be586f6b329663982e714d9e24d898c2b3f70a33020013b89ef4078ff2683e5:


package cli

// RepoUndoCmd undoes the last checkout operation.
type RepoUndoCmd struct {
	Dir string `short:"d" help:"Checkout directory" default:"."`
}

func (c *RepoUndoCmd) Run(g *Globals) error {
	r, err := g.OpenRepo()
	if err != nil {
		return err
	}
	defer r.Close()
	return r.Undo(c.Dir)
}

// RepoRedoCmd re-applies the last undone operation.
type RepoRedoCmd struct {
	Dir string `short:"d" help:"Checkout directory" default:"."`
}

func (c *RepoRedoCmd) Run(g *Globals) error {
	r, err := g.OpenRepo()
	if err != nil {
		return err
	}
	defer r.Close()
	return r.Redo(c.Dir)
}