github.com/q2/git-lfs@v0.5.1-0.20150410234700-03a0d4cec40e/commands/ls_files_test.go (about)

     1  package commands
     2  
     3  import (
     4  	"path/filepath"
     5  	"testing"
     6  )
     7  
     8  func TestLsFiles(t *testing.T) {
     9  	repo := NewRepository(t, "empty")
    10  	defer repo.Test()
    11  
    12  	cmd := repo.Command("ls-files")
    13  	cmd.Output = "a.dat"
    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 object
    20  		repo.WriteFile(filepath.Join(repo.Path, "a.dat"), "some data")
    21  		repo.GitCmd("add", "a.dat")
    22  		repo.GitCmd("commit", "-m", "a")
    23  
    24  		// Add a regular file
    25  		repo.WriteFile(filepath.Join(repo.Path, "hi.txt"), "some text")
    26  		repo.GitCmd("add", "hi.txt")
    27  		repo.GitCmd("commit", "-m", "hi")
    28  	})
    29  }