Update modules/git/repo_index.go
This commit is contained in:
parent
bd281bc953
commit
a6f7549e35
1 changed files with 5 additions and 3 deletions
|
@ -108,11 +108,13 @@ func (repo *Repository) LsFilesFromDirectory(directory, branch string) ([]string
|
|||
if branch == "" {
|
||||
return nil, errors.New("branch not found in context URL")
|
||||
}
|
||||
|
||||
cmd := NewCommand(repo.Ctx, "ls-files").AddDynamicArguments("--with-tree="+branch)
|
||||
|
||||
cmd := NewCommand(repo.Ctx, "ls-files", internal.CmdArg("--with-tree=" + branch))
|
||||
|
||||
if len(directory) > 0 {
|
||||
cmd = NewCommand(repo.Ctx, "ls-files").AddDynamicArguments("--with-tree="+branch).AddDynamicArguments("--directory").AddDynamicArguments(directory)
|
||||
cmd = NewCommand(repo.Ctx, "ls-files", internal.CmdArg("--with-tree=" + branch), internal.CmdArg("--directory"), internal.CmdArg(directory))
|
||||
}
|
||||
|
||||
res, stderror, err := cmd.RunStdBytes(&RunOpts{Dir: repo.Path})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
Loading…
Add table
Reference in a new issue