git-lfs/commands/ls_files_test.go

30 lines
649 B
Go
Raw Normal View History

2014-09-26 17:00:51 +00:00
package commands
import (
"path/filepath"
"testing"
)
func TestLsFiles(t *testing.T) {
repo := NewRepository(t, "empty")
defer repo.Test()
cmd := repo.Command("ls-files")
cmd.Output = "a.dat"
2014-09-26 17:00:51 +00:00
cmd.Before(func() {
path := filepath.Join(".git", "info", "attributes")
2015-03-19 19:30:55 +00:00
repo.WriteFile(path, "*.dat filter=lfs -crlf\n")
2014-09-26 17:00:51 +00:00
2015-03-19 19:30:55 +00:00
// Add a Git LFS object
repo.WriteFile(filepath.Join(repo.Path, "a.dat"), "some data")
repo.GitCmd("add", "a.dat")
repo.GitCmd("commit", "-m", "a")
// Add a regular file
repo.WriteFile(filepath.Join(repo.Path, "hi.txt"), "some text")
repo.GitCmd("add", "hi.txt")
repo.GitCmd("commit", "-m", "hi")
2014-09-26 17:00:51 +00:00
})
}