func GetGitFiles(fileType string, cfg *cfgreader.EarlybirdConfig) (fileContext Context, err error) {
	ignorePatterns = getIgnorePatterns(cfg.SearchDir, cfg.IgnoreFile, cfg.VerboseEnabled)
	var (
		output       []byte
		compressList []scan.File
		fileList     []scan.File
	)
	if fileType == utils.Tracked {
		output, err = exec.Command("git", "ls-tree", "--full-tree", "-r", "--name-only", "HEAD").Output()
	} else if fileType == utils.Staged {
		output, err = exec.Command("git", "--no-pager", "diff", "--name-only", "--staged").Output()
	}
	if err != nil {
		log.Println(notTrackedDir)
		return fileContext, err
	}
	fileList = parseGitFiles(output, cfg.VerboseEnabled, cfg.MaxFileSize)
	compressList, fileList = separateCompressedAndUncompressed(fileList)
	compressList, fileContext.CompressPaths, err = GetCompressedFiles(compressList, cfg.SearchDir)  
	if err != nil {
		return fileContext, err
	}
	fileContext.Files = append(fileList, compressList...)
	fileContext.IgnorePatterns = ignorePatterns
	return fileContext, nil
}
GetGitFiles Builds the list of staged or tracked files
package file
import (
	"archive/zip"
	"bufio"
	"bytes"
	"encoding/base64"
	"fmt"
	"io"
	"io/ioutil"
	"log"
	"mime/multipart"
	"os"
	"os/exec"
	"path"
	"path/filepath"
	"strings"
	cfgreader "github.com/americanexpress/earlybird/pkg/config"
	"github.com/americanexpress/earlybird/pkg/scan"
	"github.com/americanexpress/earlybird/pkg/utils"
	"github.com/americanexpress/earlybird/pkg/wildcard"
)
var (
	ignoreFiles    = [...]string{".ge_ignore", ".gitignore"}  
	ignorePatterns []string
)
func MultipartToScanFiles(files []*multipart.FileHeader, cfg cfgreader.EarlybirdConfig) (fileList []scan.File, err error) {
	ignorePatterns = getIgnorePatterns(cfg.SearchDir, cfg.IgnoreFile, cfg.VerboseEnabled)
	for _, fheader := range files {
		myfile, err := fheader.Open()
		if err != nil {
			return fileList, err
		}
		fileNameBytes, err := base64.StdEncoding.DecodeString(fheader.Filename)
		var fileName string
		if err != nil {
			fileName = fheader.Filename  
		} else {
			fileName = string(fileNameBytes)  
		}
		fileNameWithPathPrefix := fileName
		pathSeparator := "/"
		if !strings.HasPrefix(fileName, pathSeparator) {
			fileNameWithPathPrefix = pathSeparator + fileNameWithPathPrefix
		}
		if isIgnoredFile(fileNameWithPathPrefix, cfg.SearchDir) {
			continue
		}
		curFile := scan.File{
			Name: fileNameWithPathPrefix,
			Path: "buffer",
		}
		var line scan.Line
		reader := bufio.NewReader(myfile)
		for {
			var buffer bytes.Buffer
			var l []byte
			var isPrefix bool
			for {
				l, isPrefix, err = reader.ReadLine()
				buffer.Write(l)
				if !isPrefix {
					break
				}
				if err != nil {
					break
				}
			}
			if err == io.EOF {
				break
			}
			lineText := buffer.String()
			line.LineNum = line.LineNum + 1
			line.LineValue = lineText
			line.FilePath = curFile.Path
			line.FileName = fileNameWithPathPrefix
			curFile.Lines = append(curFile.Lines, line)
		}
		if err != io.EOF {
			return fileList, err
		}
		myfile.Close()
		fileList = append(fileList, curFile)
	}
	return
}