github.com/q2/git-lfs@v0.5.1-0.20150410234700-03a0d4cec40e/commands/status_test.go (about) 1 package commands 2 3 import ( 4 "path/filepath" 5 "testing" 6 ) 7 8 func TestStatus(t *testing.T) { 9 repo := NewRepository(t, "empty") 10 defer repo.Test() 11 12 cmd := repo.Command("status", "--porcelain") 13 cmd.Output = " M file1.dat 9\nA file2.dat 10\nA file3.dat 10" 14 15 cmd.Before(func() { 16 path := filepath.Join(".git", "info", "attributes") 17 repo.WriteFile(path, "*.dat filter=lfs -crlf\n") 18 19 // Add a Git LFS file 20 repo.WriteFile(filepath.Join(repo.Path, "file1.dat"), "some data") 21 repo.GitCmd("add", "file1.dat") 22 repo.GitCmd("commit", "-m", "a") 23 repo.WriteFile(filepath.Join(repo.Path, "file1.dat"), "other data") 24 25 repo.WriteFile(filepath.Join(repo.Path, "file2.dat"), "file2 data") 26 repo.GitCmd("add", "file2.dat") 27 28 repo.WriteFile(filepath.Join(repo.Path, "file3.dat"), "file3 data") 29 repo.GitCmd("add", "file3.dat") 30 repo.WriteFile(filepath.Join(repo.Path, "file3.dat"), "file3 other data") 31 }) 32 }