s
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
package gitcmd
|
||||
|
||||
import (
|
||||
"context"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func cloneBareFromWork(t *testing.T, work, bare string) *Repository {
|
||||
t.Helper()
|
||||
gitRun(t, "", nil, "clone", "--bare", "-q", work, bare)
|
||||
repo, err := OpenRepository(context.Background(), bare)
|
||||
if err != nil {
|
||||
t.Fatalf("OpenRepository: %v", err)
|
||||
}
|
||||
return repo
|
||||
}
|
||||
|
||||
func treeNames(tree *Tree) []string {
|
||||
names := make([]string, 0, len(tree.Entries))
|
||||
for _, e := range tree.Entries {
|
||||
names = append(names, e.Name)
|
||||
}
|
||||
return names
|
||||
}
|
||||
|
||||
func containsStr(haystack []string, needle string) bool {
|
||||
for _, s := range haystack {
|
||||
if s == needle {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
Reference in New Issue
Block a user