Debian Codegraph @

git/git_test.go

raw symbols SCIP
1 package git_testscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git_test`/ // to avoid import cycles
2
3 import (
4 "osscip-go gomod github.com/golang/go/src go1.25.0 os/"
5 "path/filepathscip-go gomod github.com/golang/go/src go1.25.0 `path/filepath`/"
6 "sortscip-go gomod github.com/golang/go/src go1.25.0 sort/"
7 "testingscip-go gomod github.com/golang/go/src go1.25.0 testing/"
8 "timescip-go gomod github.com/golang/go/src go1.25.0 time/"
9
10 . "github.com/git-lfs/git-lfs/v3/gitscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/"
11 testscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/ "github.com/git-lfs/git-lfs/v3/t/cmd/utilscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/"
12 "github.com/git-lfs/git-lfs/v3/toolsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tools`/"
13 "github.com/stretchr/testify/assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/"
14 )
15
16 func TestRefStringscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git_test`/TestRefString().(t *testingscip-go gomod github.com/golang/go/src go1.25.0 testing/.Tscip-go gomod github.com/golang/go/src go1.25.0 testing/T#) {
17 const sha = "0000000000000000000000000000000000000000"
18 for s, r := range map[string]*Refscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#{
19 "refs/heads/master": {
20 Namescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Name.: "master",
21 Typescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Type.: RefTypeLocalBranchscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/RefTypeLocalBranch.,
22 Shascip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Sha.: sha,
23 },
24 "refs/remotes/origin/master": {
25 Namescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Name.: "origin/master",
26 Typescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Type.: RefTypeRemoteBranchscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/RefTypeRemoteBranch.,
27 Shascip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Sha.: sha,
28 },
29 "refs/tags/v1.0.0": {
30 Namescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Name.: "v1.0.0",
31 Typescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Type.: RefTypeLocalTagscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/RefTypeLocalTag.,
32 Shascip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Sha.: sha,
33 },
34 "HEAD": {
35 Namescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Name.: "HEAD",
36 Typescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Type.: RefTypeHEADscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/RefTypeHEAD.,
37 Shascip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Sha.: sha,
38 },
39 "other": {
40 Namescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Name.: "other",
41 Typescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Type.: RefTypeOtherscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/RefTypeOther.,
42 Shascip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Sha.: sha,
43 },
44 } {
45 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, s, r.Refspecscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Refspec().())
46 }
47 }
48
49 func TestParseRefsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git_test`/TestParseRefs().(t *testingscip-go gomod github.com/golang/go/src go1.25.0 testing/.Tscip-go gomod github.com/golang/go/src go1.25.0 testing/T#) {
50 tests := map[string]RefTypescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/RefType#{
51 "refs/heads": RefTypeLocalBranchscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/RefTypeLocalBranch.,
52 "refs/tags": RefTypeLocalTagscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/RefTypeLocalTag.,
53 "refs/remotes": RefTypeRemoteBranchscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/RefTypeRemoteBranch.,
54 }
55
56 for prefix, expectedType := range tests {
57 r := ParseRefscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/ParseRef().(prefix+"/branch", "abc123")
58 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, "abc123", r.Shascip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Sha., "prefix: "+prefix)
59 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, "branch", r.Namescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Name., "prefix: "+prefix)
60 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, expectedType, r.Typescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Type., "prefix: "+prefix)
61 }
62
63 r := ParseRefscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/ParseRef().("refs/foo/branch", "abc123")
64 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, "abc123", r.Shascip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Sha., "prefix: refs/foo")
65 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, "refs/foo/branch", r.Namescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Name., "prefix: refs/foo")
66 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, RefTypeOtherscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/RefTypeOther., r.Typescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Type., "prefix: refs/foo")
67
68 r = ParseRefscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/ParseRef().("HEAD", "abc123")
69 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, "abc123", r.Shascip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Sha., "prefix: HEAD")
70 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, "HEAD", r.Namescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Name., "prefix: HEAD")
71 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, RefTypeHEADscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/RefTypeHEAD., r.Typescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Type., "prefix: HEAD")
72 }
73
74 func TestCurrentRefAndCurrentRemoteRefscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git_test`/TestCurrentRefAndCurrentRemoteRef().(t *testingscip-go gomod github.com/golang/go/src go1.25.0 testing/.Tscip-go gomod github.com/golang/go/src go1.25.0 testing/T#) {
75 repo := testscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/.NewReposcip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/NewRepo().(t)
76 repo.Pushdscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/Repo#Pushd().()
77 defer func() {
78 repo.Popdscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/Repo#Popd().()
79 repo.Cleanupscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/Repo#Cleanup().()
80 }()
81
82 // test commits; we'll just modify the same file each time since we're
83 // only interested in branches
84 inputs := []*testscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/.CommitInputscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/CommitInput#{
85 { // 0
86 Filesscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/CommitInput#Files.: []*testscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/.FileInputscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/FileInput#{
87 {Filenamescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/FileInput#Filename.: "file1.txt", Sizescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/FileInput#Size.: 20},
88 },
89 },
90 { // 1
91 NewBranchscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/CommitInput#NewBranch.: "branch2",
92 Filesscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/CommitInput#Files.: []*testscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/.FileInputscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/FileInput#{
93 {Filenamescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/FileInput#Filename.: "file1.txt", Sizescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/FileInput#Size.: 25},
94 },
95 },
96 { // 2
97 ParentBranchesscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/CommitInput#ParentBranches.: []string{"master"}, // back on master
98 Filesscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/CommitInput#Files.: []*testscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/.FileInputscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/FileInput#{
99 {Filenamescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/FileInput#Filename.: "file1.txt", Sizescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/FileInput#Size.: 30},
100 },
101 },
102 { // 3
103 NewBranchscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/CommitInput#NewBranch.: "branch3",
104 Filesscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/CommitInput#Files.: []*testscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/.FileInputscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/FileInput#{
105 {Filenamescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/FileInput#Filename.: "file1.txt", Sizescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/FileInput#Size.: 32},
106 },
107 },
108 }
109
110 outputs := repo.AddCommitsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/Repo#AddCommits().(inputs)
111
112 // last commit was on branch3
113 gitConf := repo.GitConfigscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/Repo#GitConfig().()
114 ref, err := CurrentRefscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/CurrentRef().()
115 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Nilscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Nil().(t, err)
116 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, &Refscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#{
117 Namescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Name.: "branch3",
118 Typescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Type.: RefTypeLocalBranchscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/RefTypeLocalBranch.,
119 Shascip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Sha.: outputs[3].Shascip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/CommitOutput#Sha.,
120 }, ref)
121 testscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/.RunGitCommandscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/RunGitCommand().(t, true, "checkout", "master")
122 ref, err = CurrentRefscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/CurrentRef().()
123 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Nilscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Nil().(t, err)
124 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, &Refscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#{
125 Namescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Name.: "master",
126 Typescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Type.: RefTypeLocalBranchscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/RefTypeLocalBranch.,
127 Shascip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Sha.: outputs[2].Shascip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/CommitOutput#Sha.,
128 }, ref)
129 // Check remote
130 repo.AddRemotescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/Repo#AddRemote().("origin")
131 testscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/.RunGitCommandscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/RunGitCommand().(t, true, "push", "-u", "origin", "master:someremotebranch")
132 ref, err = gitConf.CurrentRemoteRefscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Configuration#CurrentRemoteRef().()
133 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Nilscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Nil().(t, err)
134 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, &Refscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#{
135 Namescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Name.: "origin/someremotebranch",
136 Typescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Type.: RefTypeRemoteBranchscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/RefTypeRemoteBranch.,
137 Shascip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Sha.: outputs[2].Shascip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/CommitOutput#Sha.,
138 }, ref)
139
140 refname, err := gitConf.RemoteRefNameForCurrentBranchscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Configuration#RemoteRefNameForCurrentBranch().()
141 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Nilscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Nil().(t, err)
142 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, "refs/remotes/origin/someremotebranch", refname)
143
144 ref, err = ResolveRefscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/ResolveRef().(outputs[2].Shascip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/CommitOutput#Sha.)
145 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Nilscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Nil().(t, err)
146 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, &Refscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#{
147 Namescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Name.: outputs[2].Shascip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/CommitOutput#Sha.,
148 Typescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Type.: RefTypeOtherscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/RefTypeOther.,
149 Shascip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Sha.: outputs[2].Shascip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/CommitOutput#Sha.,
150 }, ref)
151 }
152
153 func TestRecentBranchesscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git_test`/TestRecentBranches().(t *testingscip-go gomod github.com/golang/go/src go1.25.0 testing/.Tscip-go gomod github.com/golang/go/src go1.25.0 testing/T#) {
154 repo := testscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/.NewReposcip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/NewRepo().(t)
155 repo.Pushdscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/Repo#Pushd().()
156 defer func() {
157 repo.Popdscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/Repo#Popd().()
158 repo.Cleanupscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/Repo#Cleanup().()
159 }()
160
161 now := timescip-go gomod github.com/golang/go/src go1.25.0 time/.Nowscip-go gomod github.com/golang/go/src go1.25.0 time/Now().()
162 // test commits; we'll just modify the same file each time since we're
163 // only interested in branches & dates
164 inputs := []*testscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/.CommitInputscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/CommitInput#{
165 { // 0
166 CommitDatescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/CommitInput#CommitDate.: now.AddDatescip-go gomod github.com/golang/go/src go1.25.0 time/Time#AddDate().(0, 0, -20),
167 Filesscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/CommitInput#Files.: []*testscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/.FileInputscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/FileInput#{
168 {Filenamescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/FileInput#Filename.: "file1.txt", Sizescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/FileInput#Size.: 20},
169 },
170 },
171 { // 1
172 CommitDatescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/CommitInput#CommitDate.: now.AddDatescip-go gomod github.com/golang/go/src go1.25.0 time/Time#AddDate().(0, 0, -15),
173 NewBranchscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/CommitInput#NewBranch.: "excluded_branch", // new branch & tag but too old
174 Tagsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/CommitInput#Tags.: []string{"excluded_tag"},
175 Filesscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/CommitInput#Files.: []*testscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/.FileInputscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/FileInput#{
176 {Filenamescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/FileInput#Filename.: "file1.txt", Sizescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/FileInput#Size.: 25},
177 },
178 },
179 { // 2
180 CommitDatescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/CommitInput#CommitDate.: now.AddDatescip-go gomod github.com/golang/go/src go1.25.0 time/Time#AddDate().(0, 0, -12),
181 ParentBranchesscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/CommitInput#ParentBranches.: []string{"master"}, // back on master
182 Filesscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/CommitInput#Files.: []*testscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/.FileInputscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/FileInput#{
183 {Filenamescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/FileInput#Filename.: "file1.txt", Sizescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/FileInput#Size.: 30},
184 },
185 },
186 { // 3
187 CommitDatescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/CommitInput#CommitDate.: now.AddDatescip-go gomod github.com/golang/go/src go1.25.0 time/Time#AddDate().(0, 0, -6),
188 NewBranchscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/CommitInput#NewBranch.: "included_branch", // new branch within 7 day limit
189 Filesscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/CommitInput#Files.: []*testscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/.FileInputscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/FileInput#{
190 {Filenamescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/FileInput#Filename.: "file1.txt", Sizescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/FileInput#Size.: 32},
191 },
192 },
193 { // 4
194 CommitDatescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/CommitInput#CommitDate.: now.AddDatescip-go gomod github.com/golang/go/src go1.25.0 time/Time#AddDate().(0, 0, -3),
195 NewBranchscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/CommitInput#NewBranch.: "included_branch_2", // new branch within 7 day limit
196 Filesscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/CommitInput#Files.: []*testscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/.FileInputscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/FileInput#{
197 {Filenamescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/FileInput#Filename.: "file1.txt", Sizescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/FileInput#Size.: 36},
198 },
199 },
200 { // 5
201 // Final commit, current date/time
202 ParentBranchesscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/CommitInput#ParentBranches.: []string{"master"}, // back on master
203 Filesscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/CommitInput#Files.: []*testscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/.FileInputscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/FileInput#{
204 {Filenamescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/FileInput#Filename.: "file1.txt", Sizescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/FileInput#Size.: 21},
205 },
206 },
207 }
208 outputs := repo.AddCommitsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/Repo#AddCommits().(inputs)
209
210 // Add a couple of remotes and push some branches
211 repo.AddRemotescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/Repo#AddRemote().("origin")
212 repo.AddRemotescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/Repo#AddRemote().("upstream")
213
214 testscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/.RunGitCommandscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/RunGitCommand().(t, true, "push", "origin", "master")
215 testscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/.RunGitCommandscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/RunGitCommand().(t, true, "push", "origin", "excluded_branch")
216 testscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/.RunGitCommandscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/RunGitCommand().(t, true, "push", "origin", "included_branch")
217 testscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/.RunGitCommandscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/RunGitCommand().(t, true, "push", "upstream", "master")
218 testscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/.RunGitCommandscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/RunGitCommand().(t, true, "push", "upstream", "included_branch_2")
219
220 // Recent, local only
221 refs, err := RecentBranchesscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/RecentBranches().(now.AddDatescip-go gomod github.com/golang/go/src go1.25.0 time/Time#AddDate().(0, 0, -7), false, "")
222 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, nil, err)
223 expectedRefs := []*Refscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#{
224 {
225 Namescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Name.: "master",
226 Typescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Type.: RefTypeLocalBranchscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/RefTypeLocalBranch.,
227 Shascip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Sha.: outputs[5].Shascip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/CommitOutput#Sha.,
228 },
229 {
230 Namescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Name.: "included_branch_2",
231 Typescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Type.: RefTypeLocalBranchscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/RefTypeLocalBranch.,
232 Shascip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Sha.: outputs[4].Shascip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/CommitOutput#Sha.,
233 },
234 {
235 Namescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Name.: "included_branch",
236 Typescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Type.: RefTypeLocalBranchscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/RefTypeLocalBranch.,
237 Shascip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Sha.: outputs[3].Shascip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/CommitOutput#Sha.,
238 },
239 }
240 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, expectedRefs, refs, "Refs should be correct")
241
242 // Recent, remotes too (all of them)
243 refs, err = RecentBranchesscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/RecentBranches().(now.AddDatescip-go gomod github.com/golang/go/src go1.25.0 time/Time#AddDate().(0, 0, -7), true, "")
244 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, nil, err)
245 expectedRefs = []*Refscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#{
246 {
247 Namescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Name.: "master",
248 Typescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Type.: RefTypeLocalBranchscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/RefTypeLocalBranch.,
249 Shascip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Sha.: outputs[5].Shascip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/CommitOutput#Sha.,
250 },
251 {
252 Namescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Name.: "included_branch_2",
253 Typescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Type.: RefTypeLocalBranchscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/RefTypeLocalBranch.,
254 Shascip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Sha.: outputs[4].Shascip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/CommitOutput#Sha.,
255 },
256 {
257 Namescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Name.: "included_branch",
258 Typescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Type.: RefTypeLocalBranchscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/RefTypeLocalBranch.,
259 Shascip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Sha.: outputs[3].Shascip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/CommitOutput#Sha.,
260 },
261 {
262 Namescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Name.: "upstream/master",
263 Typescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Type.: RefTypeRemoteBranchscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/RefTypeRemoteBranch.,
264 Shascip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Sha.: outputs[5].Shascip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/CommitOutput#Sha.,
265 },
266 {
267 Namescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Name.: "upstream/included_branch_2",
268 Typescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Type.: RefTypeRemoteBranchscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/RefTypeRemoteBranch.,
269 Shascip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Sha.: outputs[4].Shascip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/CommitOutput#Sha.,
270 },
271 {
272 Namescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Name.: "origin/master",
273 Typescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Type.: RefTypeRemoteBranchscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/RefTypeRemoteBranch.,
274 Shascip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Sha.: outputs[5].Shascip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/CommitOutput#Sha.,
275 },
276 {
277 Namescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Name.: "origin/included_branch",
278 Typescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Type.: RefTypeRemoteBranchscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/RefTypeRemoteBranch.,
279 Shascip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Sha.: outputs[3].Shascip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/CommitOutput#Sha.,
280 },
281 }
282 // Need to sort for consistent comparison
283 sortscip-go gomod github.com/golang/go/src go1.25.0 sort/.Sortscip-go gomod github.com/golang/go/src go1.25.0 sort/Sort().(testscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/.RefsByNamescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/RefsByName#(expectedRefs))
284 sortscip-go gomod github.com/golang/go/src go1.25.0 sort/.Sortscip-go gomod github.com/golang/go/src go1.25.0 sort/Sort().(testscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/.RefsByNamescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/RefsByName#(refs))
285 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, expectedRefs, refs, "Refs should be correct")
286
287 // Recent, only single remote
288 refs, err = RecentBranchesscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/RecentBranches().(now.AddDatescip-go gomod github.com/golang/go/src go1.25.0 time/Time#AddDate().(0, 0, -7), true, "origin")
289 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, nil, err)
290 expectedRefs = []*Refscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#{
291 {
292 Namescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Name.: "master",
293 Typescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Type.: RefTypeLocalBranchscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/RefTypeLocalBranch.,
294 Shascip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Sha.: outputs[5].Shascip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/CommitOutput#Sha.,
295 },
296 {
297 Namescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Name.: "origin/master",
298 Typescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Type.: RefTypeRemoteBranchscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/RefTypeRemoteBranch.,
299 Shascip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Sha.: outputs[5].Shascip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/CommitOutput#Sha.,
300 },
301 {
302 Namescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Name.: "included_branch_2",
303 Typescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Type.: RefTypeLocalBranchscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/RefTypeLocalBranch.,
304 Shascip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Sha.: outputs[4].Shascip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/CommitOutput#Sha.,
305 },
306 {
307 Namescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Name.: "included_branch",
308 Typescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Type.: RefTypeLocalBranchscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/RefTypeLocalBranch.,
309 Shascip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Sha.: outputs[3].Shascip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/CommitOutput#Sha.,
310 },
311 {
312 Namescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Name.: "origin/included_branch",
313 Typescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Type.: RefTypeRemoteBranchscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/RefTypeRemoteBranch.,
314 Shascip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Sha.: outputs[3].Shascip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/CommitOutput#Sha.,
315 },
316 }
317 // Need to sort for consistent comparison
318 sortscip-go gomod github.com/golang/go/src go1.25.0 sort/.Sortscip-go gomod github.com/golang/go/src go1.25.0 sort/Sort().(testscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/.RefsByNamescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/RefsByName#(expectedRefs))
319 sortscip-go gomod github.com/golang/go/src go1.25.0 sort/.Sortscip-go gomod github.com/golang/go/src go1.25.0 sort/Sort().(testscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/.RefsByNamescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/RefsByName#(refs))
320 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, expectedRefs, refs, "Refs should be correct")
321 }
322
323 func TestResolveEmptyCurrentRefscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git_test`/TestResolveEmptyCurrentRef().(t *testingscip-go gomod github.com/golang/go/src go1.25.0 testing/.Tscip-go gomod github.com/golang/go/src go1.25.0 testing/T#) {
324 repo := testscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/.NewReposcip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/NewRepo().(t)
325 repo.Pushdscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/Repo#Pushd().()
326 defer func() {
327 repo.Popdscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/Repo#Popd().()
328 repo.Cleanupscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/Repo#Cleanup().()
329 }()
330
331 _, err := CurrentRefscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/CurrentRef().()
332 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.NotEqualscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/NotEqual().(t, nil, err)
333 }
334
335 func TestWorktreesscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git_test`/TestWorktrees().(t *testingscip-go gomod github.com/golang/go/src go1.25.0 testing/.Tscip-go gomod github.com/golang/go/src go1.25.0 testing/T#) {
336 // Only git 2.5+
337 if !IsGitVersionAtLeastscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/IsGitVersionAtLeast().("2.5.0") {
338 return
339 }
340
341 repo := testscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/.NewReposcip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/NewRepo().(t)
342 repo.Pushdscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/Repo#Pushd().()
343 defer func() {
344 repo.Popdscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/Repo#Popd().()
345 repo.Cleanupscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/Repo#Cleanup().()
346 }()
347
348 repoDir, _ := toolsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tools`/.CanonicalizePathscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tools`/CanonicalizePath().(repo.Pathscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/Repo#Path., true)
349
350 // test commits; we'll just modify the same file each time since we're
351 // only interested in branches & dates
352 inputs := []*testscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/.CommitInputscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/CommitInput#{
353 { // 0
354 Filesscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/CommitInput#Files.: []*testscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/.FileInputscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/FileInput#{
355 {Filenamescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/FileInput#Filename.: "file1.txt", Sizescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/FileInput#Size.: 10},
356 },
357 Tagsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/CommitInput#Tags.: []string{"tag1"},
358 },
359 { // 1
360 Filesscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/CommitInput#Files.: []*testscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/.FileInputscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/FileInput#{
361 {Filenamescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/FileInput#Filename.: "file1.txt", Sizescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/FileInput#Size.: 20},
362 },
363 },
364 { // 2
365 NewBranchscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/CommitInput#NewBranch.: "branch2",
366 Filesscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/CommitInput#Files.: []*testscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/.FileInputscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/FileInput#{
367 {Filenamescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/FileInput#Filename.: "file1.txt", Sizescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/FileInput#Size.: 25},
368 },
369 },
370 { // 3
371 NewBranchscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/CommitInput#NewBranch.: "branch3",
372 ParentBranchesscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/CommitInput#ParentBranches.: []string{"master"}, // back on master
373 Filesscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/CommitInput#Files.: []*testscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/.FileInputscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/FileInput#{
374 {Filenamescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/FileInput#Filename.: "file1.txt", Sizescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/FileInput#Size.: 30},
375 },
376 },
377 { // 4
378 NewBranchscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/CommitInput#NewBranch.: "branch4",
379 ParentBranchesscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/CommitInput#ParentBranches.: []string{"master"}, // back on master
380 Filesscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/CommitInput#Files.: []*testscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/.FileInputscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/FileInput#{
381 {Filenamescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/FileInput#Filename.: "file1.txt", Sizescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/FileInput#Size.: 40},
382 },
383 },
384 { // 5
385 NewBranchscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/CommitInput#NewBranch.: "branch5",
386 ParentBranchesscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/CommitInput#ParentBranches.: []string{"master"}, // back on master
387 Filesscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/CommitInput#Files.: []*testscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/.FileInputscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/FileInput#{
388 {Filenamescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/FileInput#Filename.: "file1.txt", Sizescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/FileInput#Size.: 50},
389 },
390 },
391 }
392 outputs := repo.AddCommitsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/Repo#AddCommits().(inputs)
393 // Checkout master again otherwise can't create a worktree from branch4 if we're on it here
394 testscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/.RunGitCommandscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/RunGitCommand().(t, true, "checkout", "master")
395
396 // We can create worktrees as subfolders for convenience
397 // Each one is checked out to a different branch
398 // Note that we *won't* create one for branch3
399 testscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/.RunGitCommandscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/RunGitCommand().(t, true, "worktree", "add", "tag1_wt", "tag1")
400 testscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/.RunGitCommandscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/RunGitCommand().(t, true, "worktree", "add", "branch2_wt", "branch2")
401 testscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/.RunGitCommandscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/RunGitCommand().(t, true, "worktree", "add", "branch4_wt", "branch4")
402 testscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/.RunGitCommandscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/RunGitCommand().(t, true, "worktree", "add", "branch5_wt", "branch5")
403
404 osscip-go gomod github.com/golang/go/src go1.25.0 os/.RemoveAllscip-go gomod github.com/golang/go/src go1.25.0 os/RemoveAll().(filepathscip-go gomod github.com/golang/go/src go1.25.0 `path/filepath`/.Joinscip-go gomod github.com/golang/go/src go1.25.0 `path/filepath`/Join().(repoDir, "branch5_wt"))
405
406 worktrees, err := GetAllWorktreesscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/GetAllWorktrees().(filepathscip-go gomod github.com/golang/go/src go1.25.0 `path/filepath`/.Joinscip-go gomod github.com/golang/go/src go1.25.0 `path/filepath`/Join().(repo.Pathscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/Repo#Path., ".git"))
407 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.NoErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/NoError().(t, err)
408 expectedWorktrees := []*Worktreescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Worktree#{
409 {
410 Refscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Worktree#Ref.: Refscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#{
411 Namescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Name.: outputs[0].Shascip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/CommitOutput#Sha.,
412 Typescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Type.: RefTypeOtherscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/RefTypeOther.,
413 Shascip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Sha.: outputs[0].Shascip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/CommitOutput#Sha.,
414 },
415 Dirscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Worktree#Dir.: filepathscip-go gomod github.com/golang/go/src go1.25.0 `path/filepath`/.Joinscip-go gomod github.com/golang/go/src go1.25.0 `path/filepath`/Join().(repoDir, "tag1_wt"),
416 Prunablescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Worktree#Prunable.: false,
417 },
418 {
419 Refscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Worktree#Ref.: Refscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#{
420 Namescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Name.: "master",
421 Typescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Type.: RefTypeLocalBranchscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/RefTypeLocalBranch.,
422 Shascip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Sha.: outputs[1].Shascip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/CommitOutput#Sha.,
423 },
424 Dirscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Worktree#Dir.: repoDir,
425 Prunablescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Worktree#Prunable.: false,
426 },
427 {
428 Refscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Worktree#Ref.: Refscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#{
429 Namescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Name.: "branch2",
430 Typescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Type.: RefTypeLocalBranchscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/RefTypeLocalBranch.,
431 Shascip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Sha.: outputs[2].Shascip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/CommitOutput#Sha.,
432 },
433 Dirscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Worktree#Dir.: filepathscip-go gomod github.com/golang/go/src go1.25.0 `path/filepath`/.Joinscip-go gomod github.com/golang/go/src go1.25.0 `path/filepath`/Join().(repoDir, "branch2_wt"),
434 Prunablescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Worktree#Prunable.: false,
435 },
436 {
437 Refscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Worktree#Ref.: Refscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#{
438 Namescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Name.: "branch4",
439 Typescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Type.: RefTypeLocalBranchscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/RefTypeLocalBranch.,
440 Shascip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Sha.: outputs[4].Shascip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/CommitOutput#Sha.,
441 },
442 Dirscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Worktree#Dir.: filepathscip-go gomod github.com/golang/go/src go1.25.0 `path/filepath`/.Joinscip-go gomod github.com/golang/go/src go1.25.0 `path/filepath`/Join().(repoDir, "branch4_wt"),
443 Prunablescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Worktree#Prunable.: false,
444 },
445 {
446 Refscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Worktree#Ref.: Refscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#{
447 Namescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Name.: "branch5",
448 Typescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Type.: RefTypeLocalBranchscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/RefTypeLocalBranch.,
449 Shascip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Sha.: outputs[5].Shascip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/CommitOutput#Sha.,
450 },
451 Dirscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Worktree#Dir.: filepathscip-go gomod github.com/golang/go/src go1.25.0 `path/filepath`/.Joinscip-go gomod github.com/golang/go/src go1.25.0 `path/filepath`/Join().(repoDir, "branch5_wt"),
452 Prunablescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Worktree#Prunable.: true,
453 },
454 }
455 // Need to sort for consistent comparison
456 sortscip-go gomod github.com/golang/go/src go1.25.0 sort/.Sortscip-go gomod github.com/golang/go/src go1.25.0 sort/Sort().(testscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/.WorktreesByNamescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/WorktreesByName#(expectedWorktrees))
457 sortscip-go gomod github.com/golang/go/src go1.25.0 sort/.Sortscip-go gomod github.com/golang/go/src go1.25.0 sort/Sort().(testscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/.WorktreesByNamescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/WorktreesByName#(worktrees))
458 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, expectedWorktrees, worktrees, "Worktrees should be correct")
459 }
460
461 func TestWorktreesBareReposcip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git_test`/TestWorktreesBareRepo().(t *testingscip-go gomod github.com/golang/go/src go1.25.0 testing/.Tscip-go gomod github.com/golang/go/src go1.25.0 testing/T#) {
462 // Only git 2.5+
463 if !IsGitVersionAtLeastscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/IsGitVersionAtLeast().("2.5.0") {
464 return
465 }
466
467 repo := testscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/.NewBareReposcip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/NewBareRepo().(t)
468 repo.Pushdscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/Repo#Pushd().()
469 defer func() {
470 repo.Popdscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/Repo#Popd().()
471 repo.Cleanupscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/Repo#Cleanup().()
472 }()
473
474 worktrees, err := GetAllWorktreesscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/GetAllWorktrees().(repo.Pathscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/Repo#Path.)
475 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.NoErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/NoError().(t, err)
476 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Nilscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Nil().(t, worktrees)
477 }
478
479 func TestVersionComparescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git_test`/TestVersionCompare().(t *testingscip-go gomod github.com/golang/go/src go1.25.0 testing/.Tscip-go gomod github.com/golang/go/src go1.25.0 testing/T#) {
480 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Truescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/True().(t, IsVersionAtLeastscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/IsVersionAtLeast().("2.6.0", "2.6.0"))
481 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Truescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/True().(t, IsVersionAtLeastscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/IsVersionAtLeast().("2.6.0", "2.6"))
482 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Truescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/True().(t, IsVersionAtLeastscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/IsVersionAtLeast().("2.6.0", "2"))
483 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Truescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/True().(t, IsVersionAtLeastscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/IsVersionAtLeast().("2.6.10", "2.6.5"))
484 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Truescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/True().(t, IsVersionAtLeastscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/IsVersionAtLeast().("2.8.1", "2.7.2"))
485
486 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Falsescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/False().(t, IsVersionAtLeastscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/IsVersionAtLeast().("1.6.0", "2"))
487 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Falsescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/False().(t, IsVersionAtLeastscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/IsVersionAtLeast().("2.5.0", "2.6"))
488 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Falsescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/False().(t, IsVersionAtLeastscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/IsVersionAtLeast().("2.5.0", "2.5.1"))
489 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Falsescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/False().(t, IsVersionAtLeastscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/IsVersionAtLeast().("2.5.2", "2.5.10"))
490 }
491
492 func TestGitAndRootDirsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git_test`/TestGitAndRootDirs().(t *testingscip-go gomod github.com/golang/go/src go1.25.0 testing/.Tscip-go gomod github.com/golang/go/src go1.25.0 testing/T#) {
493 repo := testscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/.NewReposcip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/NewRepo().(t)
494 repo.Pushdscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/Repo#Pushd().()
495 defer func() {
496 repo.Popdscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/Repo#Popd().()
497 repo.Cleanupscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/Repo#Cleanup().()
498 }()
499
500 git, root, err := GitAndRootDirsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/GitAndRootDirs().()
501 if err != nil {
502 t.Fatalscip-go gomod github.com/golang/go/src go1.25.0 testing/common#Fatal().(err)
503 }
504
505 expected, err := osscip-go gomod github.com/golang/go/src go1.25.0 os/.Statscip-go gomod github.com/golang/go/src go1.25.0 os/Stat().(git)
506 if err != nil {
507 t.Fatalscip-go gomod github.com/golang/go/src go1.25.0 testing/common#Fatal().(err)
508 }
509
510 actual, err := osscip-go gomod github.com/golang/go/src go1.25.0 os/.Statscip-go gomod github.com/golang/go/src go1.25.0 os/Stat().(filepathscip-go gomod github.com/golang/go/src go1.25.0 `path/filepath`/.Joinscip-go gomod github.com/golang/go/src go1.25.0 `path/filepath`/Join().(root, ".git"))
511 if err != nil {
512 t.Fatalscip-go gomod github.com/golang/go/src go1.25.0 testing/common#Fatal().(err)
513 }
514
515 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Truescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/True().(t, osscip-go gomod github.com/golang/go/src go1.25.0 os/.SameFilescip-go gomod github.com/golang/go/src go1.25.0 os/SameFile().(expected, actual))
516 }
517
518 func TestGetTrackedFilesscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git_test`/TestGetTrackedFiles().(t *testingscip-go gomod github.com/golang/go/src go1.25.0 testing/.Tscip-go gomod github.com/golang/go/src go1.25.0 testing/T#) {
519 repo := testscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/.NewReposcip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/NewRepo().(t)
520 repo.Pushdscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/Repo#Pushd().()
521 defer func() {
522 repo.Popdscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/Repo#Popd().()
523 repo.Cleanupscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/Repo#Cleanup().()
524 }()
525
526 // test commits; we'll just modify the same file each time since we're
527 // only interested in branches
528 inputs := []*testscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/.CommitInputscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/CommitInput#{
529 { // 0
530 Filesscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/CommitInput#Files.: []*testscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/.FileInputscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/FileInput#{
531 {Filenamescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/FileInput#Filename.: "file1.txt", Sizescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/FileInput#Size.: 20},
532 {Filenamescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/FileInput#Filename.: "file2.txt", Sizescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/FileInput#Size.: 20},
533 {Filenamescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/FileInput#Filename.: "folder1/file10.txt", Sizescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/FileInput#Size.: 20},
534 {Filenamescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/FileInput#Filename.: "folder1/anotherfile.txt", Sizescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/FileInput#Size.: 20},
535 },
536 },
537 { // 1
538 Filesscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/CommitInput#Files.: []*testscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/.FileInputscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/FileInput#{
539 {Filenamescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/FileInput#Filename.: "file3.txt", Sizescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/FileInput#Size.: 20},
540 {Filenamescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/FileInput#Filename.: "file4.txt", Sizescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/FileInput#Size.: 20},
541 {Filenamescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/FileInput#Filename.: "folder2/something.txt", Sizescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/FileInput#Size.: 20},
542 {Filenamescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/FileInput#Filename.: "folder2/folder3/deep.txt", Sizescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/FileInput#Size.: 20},
543 },
544 },
545 }
546 repo.AddCommitsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/Repo#AddCommits().(inputs)
547
548 tracked, err := GetTrackedFilesscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/GetTrackedFiles().("*.txt")
549 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Nilscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Nil().(t, err)
550 sortscip-go gomod github.com/golang/go/src go1.25.0 sort/.Stringsscip-go gomod github.com/golang/go/src go1.25.0 sort/Strings().(tracked) // for direct comparison
551 fulllist := []string{"file1.txt", "file2.txt", "file3.txt", "file4.txt", "folder1/anotherfile.txt", "folder1/file10.txt", "folder2/folder3/deep.txt", "folder2/something.txt"}
552 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, fulllist, tracked)
553
554 tracked, err = GetTrackedFilesscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/GetTrackedFiles().("*file*.txt")
555 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Nilscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Nil().(t, err)
556 sortscip-go gomod github.com/golang/go/src go1.25.0 sort/.Stringsscip-go gomod github.com/golang/go/src go1.25.0 sort/Strings().(tracked)
557 sublist := []string{"file1.txt", "file2.txt", "file3.txt", "file4.txt", "folder1/anotherfile.txt", "folder1/file10.txt"}
558 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, sublist, tracked)
559
560 tracked, err = GetTrackedFilesscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/GetTrackedFiles().("folder1/*")
561 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Nilscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Nil().(t, err)
562 sortscip-go gomod github.com/golang/go/src go1.25.0 sort/.Stringsscip-go gomod github.com/golang/go/src go1.25.0 sort/Strings().(tracked)
563 sublist = []string{"folder1/anotherfile.txt", "folder1/file10.txt"}
564 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, sublist, tracked)
565
566 tracked, err = GetTrackedFilesscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/GetTrackedFiles().("folder2/*")
567 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Nilscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Nil().(t, err)
568 sortscip-go gomod github.com/golang/go/src go1.25.0 sort/.Stringsscip-go gomod github.com/golang/go/src go1.25.0 sort/Strings().(tracked)
569 sublist = []string{"folder2/folder3/deep.txt", "folder2/something.txt"}
570 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, sublist, tracked)
571
572 // relative dir
573 osscip-go gomod github.com/golang/go/src go1.25.0 os/.Chdirscip-go gomod github.com/golang/go/src go1.25.0 os/Chdir().("folder1")
574 tracked, err = GetTrackedFilesscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/GetTrackedFiles().("*.txt")
575 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Nilscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Nil().(t, err)
576 sortscip-go gomod github.com/golang/go/src go1.25.0 sort/.Stringsscip-go gomod github.com/golang/go/src go1.25.0 sort/Strings().(tracked)
577 sublist = []string{"anotherfile.txt", "file10.txt"}
578 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, sublist, tracked)
579 osscip-go gomod github.com/golang/go/src go1.25.0 os/.Chdirscip-go gomod github.com/golang/go/src go1.25.0 os/Chdir().("..")
580
581 // absolute paths only includes matches in repo root
582 tracked, err = GetTrackedFilesscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/GetTrackedFiles().("/*.txt")
583 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Nilscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Nil().(t, err)
584 sortscip-go gomod github.com/golang/go/src go1.25.0 sort/.Stringsscip-go gomod github.com/golang/go/src go1.25.0 sort/Strings().(tracked)
585 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, []string{"file1.txt", "file2.txt", "file3.txt", "file4.txt"}, tracked)
586
587 // Test includes staged but uncommitted files
588 osscip-go gomod github.com/golang/go/src go1.25.0 os/.WriteFilescip-go gomod github.com/golang/go/src go1.25.0 os/WriteFile().("z_newfile.txt", []byte("Hello world"), 0644)
589 testscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/.RunGitCommandscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/RunGitCommand().(t, true, "add", "z_newfile.txt")
590 tracked, err = GetTrackedFilesscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/GetTrackedFiles().("*.txt")
591 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Nilscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Nil().(t, err)
592 sortscip-go gomod github.com/golang/go/src go1.25.0 sort/.Stringsscip-go gomod github.com/golang/go/src go1.25.0 sort/Strings().(tracked)
593 fulllist = append(fulllist, "z_newfile.txt")
594 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, fulllist, tracked)
595
596 // Test includes modified files (not staged)
597 osscip-go gomod github.com/golang/go/src go1.25.0 os/.WriteFilescip-go gomod github.com/golang/go/src go1.25.0 os/WriteFile().("file1.txt", []byte("Modifications"), 0644)
598 tracked, err = GetTrackedFilesscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/GetTrackedFiles().("*.txt")
599 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Nilscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Nil().(t, err)
600 sortscip-go gomod github.com/golang/go/src go1.25.0 sort/.Stringsscip-go gomod github.com/golang/go/src go1.25.0 sort/Strings().(tracked)
601 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, fulllist, tracked)
602
603 // Test includes modified files (staged)
604 testscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/.RunGitCommandscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/RunGitCommand().(t, true, "add", "file1.txt")
605 tracked, err = GetTrackedFilesscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/GetTrackedFiles().("*.txt")
606 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Nilscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Nil().(t, err)
607 sortscip-go gomod github.com/golang/go/src go1.25.0 sort/.Stringsscip-go gomod github.com/golang/go/src go1.25.0 sort/Strings().(tracked)
608 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, fulllist, tracked)
609
610 // Test excludes deleted files (not committed)
611 testscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/.RunGitCommandscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/RunGitCommand().(t, true, "rm", "file2.txt")
612 tracked, err = GetTrackedFilesscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/GetTrackedFiles().("*.txt")
613 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Nilscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Nil().(t, err)
614 sortscip-go gomod github.com/golang/go/src go1.25.0 sort/.Stringsscip-go gomod github.com/golang/go/src go1.25.0 sort/Strings().(tracked)
615 deletedlist := []string{"file1.txt", "file3.txt", "file4.txt", "folder1/anotherfile.txt", "folder1/file10.txt", "folder2/folder3/deep.txt", "folder2/something.txt", "z_newfile.txt"}
616 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, deletedlist, tracked)
617
618 }
619
620 func TestLocalRefsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git_test`/TestLocalRefs().(t *testingscip-go gomod github.com/golang/go/src go1.25.0 testing/.Tscip-go gomod github.com/golang/go/src go1.25.0 testing/T#) {
621 repo := testscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/.NewReposcip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/NewRepo().(t)
622 repo.Pushdscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/Repo#Pushd().()
623 defer func() {
624 repo.Popdscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/Repo#Popd().()
625 repo.Cleanupscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/Repo#Cleanup().()
626 }()
627
628 repo.AddCommitsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/Repo#AddCommits().([]*testscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/.CommitInputscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/CommitInput#{
629 {
630 Filesscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/CommitInput#Files.: []*testscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/.FileInputscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/FileInput#{
631 {Filenamescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/FileInput#Filename.: "file1.txt", Sizescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/FileInput#Size.: 20},
632 },
633 },
634 {
635 NewBranchscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/CommitInput#NewBranch.: "branch",
636 ParentBranchesscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/CommitInput#ParentBranches.: []string{"master"},
637 Filesscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/CommitInput#Files.: []*testscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/.FileInputscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/FileInput#{
638 {Filenamescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/FileInput#Filename.: "file1.txt", Sizescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/FileInput#Size.: 20},
639 },
640 },
641 })
642
643 testscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/.RunGitCommandscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/RunGitCommand().(t, true, "tag", "v1")
644
645 refs, err := LocalRefsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/LocalRefs().()
646 if err != nil {
647 t.Fatalscip-go gomod github.com/golang/go/src go1.25.0 testing/common#Fatal().(err)
648 }
649
650 actual := make(map[string]bool)
651 for _, r := range refs {
652 t.Logfscip-go gomod github.com/golang/go/src go1.25.0 testing/common#Logf().("REF: %s", r.Namescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Name.)
653 switch r.Typescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Type. {
654 case RefTypeHEADscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/RefTypeHEAD.:
655 t.Errorfscip-go gomod github.com/golang/go/src go1.25.0 testing/common#Errorf().("Local HEAD ref: %v", r)
656 case RefTypeOtherscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/RefTypeOther.:
657 t.Errorfscip-go gomod github.com/golang/go/src go1.25.0 testing/common#Errorf().("Stash or unknown ref: %v", r)
658 default:
659 actual[r.Namescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Name.] = true
660 }
661 }
662
663 expected := []string{"master", "branch", "v1"}
664 found := 0
665 for _, refname := range expected {
666 if actual[refname] {
667 found += 1
668 } else {
669 t.Errorfscip-go gomod github.com/golang/go/src go1.25.0 testing/common#Errorf().("could not find ref %q", refname)
670 }
671 }
672
673 if found != len(expected) {
674 t.Errorfscip-go gomod github.com/golang/go/src go1.25.0 testing/common#Errorf().("Unexpected local refs: %v", actual)
675 }
676 }
677
678 func TestGetFilesChangesscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git_test`/TestGetFilesChanges().(t *testingscip-go gomod github.com/golang/go/src go1.25.0 testing/.Tscip-go gomod github.com/golang/go/src go1.25.0 testing/T#) {
679 repo := testscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/.NewReposcip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/NewRepo().(t)
680 repo.Pushdscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/Repo#Pushd().()
681 defer func() {
682 repo.Popdscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/Repo#Popd().()
683 repo.Cleanupscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/Repo#Cleanup().()
684 }()
685
686 commits := repo.AddCommitsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/Repo#AddCommits().([]*testscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/.CommitInputscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/CommitInput#{
687 {
688 Filesscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/CommitInput#Files.: []*testscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/.FileInputscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/FileInput#{
689 {Filenamescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/FileInput#Filename.: "file1.txt", Sizescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/FileInput#Size.: 20},
690 },
691 },
692 {
693 Filesscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/CommitInput#Files.: []*testscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/.FileInputscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/FileInput#{
694 {Filenamescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/FileInput#Filename.: "file1.txt", Sizescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/FileInput#Size.: 25},
695 {Filenamescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/FileInput#Filename.: "file2.txt", Sizescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/FileInput#Size.: 20},
696 {Filenamescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/FileInput#Filename.: "folder/file3.txt", Sizescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/FileInput#Size.: 10},
697 },
698 Tagsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/CommitInput#Tags.: []string{"tag1"},
699 },
700 {
701 NewBranchscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/CommitInput#NewBranch.: "abranch",
702 ParentBranchesscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/CommitInput#ParentBranches.: []string{"master"},
703 Filesscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/CommitInput#Files.: []*testscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/.FileInputscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/FileInput#{
704 {Filenamescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/FileInput#Filename.: "file1.txt", Sizescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/FileInput#Size.: 30},
705 {Filenamescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/FileInput#Filename.: "file4.txt", Sizescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/FileInput#Size.: 40},
706 },
707 },
708 })
709
710 expected0to1 := []string{"file1.txt", "file2.txt", "folder/file3.txt"}
711 expected1to2 := []string{"file1.txt", "file4.txt"}
712 expected0to2 := []string{"file1.txt", "file2.txt", "file4.txt", "folder/file3.txt"}
713 // Test 2 SHAs
714 changes, err := GetFilesChangedscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/GetFilesChanged().(commits[0].Shascip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/CommitOutput#Sha., commits[1].Shascip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/CommitOutput#Sha.)
715 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Nilscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Nil().(t, err)
716 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, expected0to1, changes)
717 // Test SHA & tag
718 changes, err = GetFilesChangedscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/GetFilesChanged().(commits[0].Shascip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/CommitOutput#Sha., "tag1")
719 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Nilscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Nil().(t, err)
720 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, expected0to1, changes)
721 // Test SHA & branch
722 changes, err = GetFilesChangedscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/GetFilesChanged().(commits[0].Shascip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/CommitOutput#Sha., "abranch")
723 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Nilscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Nil().(t, err)
724 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, expected0to2, changes)
725 // Test tag & branch
726 changes, err = GetFilesChangedscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/GetFilesChanged().("tag1", "abranch")
727 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Nilscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Nil().(t, err)
728 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, expected1to2, changes)
729 // Test fail
730 _, err = GetFilesChangedscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/GetFilesChanged().("tag1", "nonexisting")
731 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.NotNilscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/NotNil().(t, err)
732 _, err = GetFilesChangedscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/GetFilesChanged().("nonexisting", "tag1")
733 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.NotNilscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/NotNil().(t, err)
734 // Test Single arg version
735 changes, err = GetFilesChangedscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/GetFilesChanged().(commits[1].Shascip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/CommitOutput#Sha., "")
736 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Nilscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Nil().(t, err)
737 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, expected0to1, changes)
738 changes, err = GetFilesChangedscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/GetFilesChanged().("abranch", "")
739 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Nilscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Nil().(t, err)
740 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, expected1to2, changes)
741
742 }
743
744 func TestValidateRemoteURLscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git_test`/TestValidateRemoteURL().(t *testingscip-go gomod github.com/golang/go/src go1.25.0 testing/.Tscip-go gomod github.com/golang/go/src go1.25.0 testing/T#) {
745 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Nilscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Nil().(t, ValidateRemoteURLscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/ValidateRemoteURL().("https://github.com/git-lfs/git-lfs"))
746 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Nilscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Nil().(t, ValidateRemoteURLscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/ValidateRemoteURL().("http://github.com/git-lfs/git-lfs"))
747 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Nilscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Nil().(t, ValidateRemoteURLscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/ValidateRemoteURL().("git://github.com/git-lfs/git-lfs"))
748 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Nilscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Nil().(t, ValidateRemoteURLscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/ValidateRemoteURL().("ssh://[email protected]/git-lfs/git-lfs"))
749 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Nilscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Nil().(t, ValidateRemoteURLscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/ValidateRemoteURL().("ssh://[email protected]:22/git-lfs/git-lfs"))
750 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Nilscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Nil().(t, ValidateRemoteURLscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/ValidateRemoteURL().("[email protected]:git-lfs/git-lfs"))
751 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Nilscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Nil().(t, ValidateRemoteURLscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/ValidateRemoteURL().("git@server:/absolute/path.git"))
752 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.NotNilscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/NotNil().(t, ValidateRemoteURLscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/ValidateRemoteURL().("ftp://[email protected]/git-lfs/git-lfs"))
753 }
754
755 func TestRefTypeKnownPrefixesscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git_test`/TestRefTypeKnownPrefixes().(t *testingscip-go gomod github.com/golang/go/src go1.25.0 testing/.Tscip-go gomod github.com/golang/go/src go1.25.0 testing/T#) {
756 for typ, expected := range map[RefTypescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/RefType#]struct {
757 Prefix string
758 Ok bool
759 }{
760 RefTypeLocalBranchscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/RefTypeLocalBranch.: {"refs/heads", true},
761 RefTypeRemoteBranchscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/RefTypeRemoteBranch.: {"refs/remotes", true},
762 RefTypeLocalTagscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/RefTypeLocalTag.: {"refs/tags", true},
763 RefTypeHEADscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/RefTypeHEAD.: {"", false},
764 RefTypeOtherscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/RefTypeOther.: {"", false},
765 } {
766 prefix, ok := typ.Prefixscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/RefType#Prefix().()
767
768 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, expected.Prefix, prefix)
769 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, expected.Ok, ok)
770 }
771 }
772
773 func TestRemoteURLsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git_test`/TestRemoteURLs().(t *testingscip-go gomod github.com/golang/go/src go1.25.0 testing/.Tscip-go gomod github.com/golang/go/src go1.25.0 testing/T#) {
774 repo := testscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/.NewReposcip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/NewRepo().(t)
775 repo.Pushdscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/Repo#Pushd().()
776 defer func() {
777 repo.Popdscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/Repo#Popd().()
778 repo.Cleanupscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/Repo#Cleanup().()
779 }()
780 cfg := repo.GitConfigscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/Repo#GitConfig().()
781 cfg.SetLocalscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Configuration#SetLocal().("remote.foo.url", "https://github.com/git-lfs/git-lfs.git")
782 cfg.SetLocalscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Configuration#SetLocal().("remote.bar.url", "https://github.com/git-lfs/wildmatch.git")
783 cfg.SetLocalscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Configuration#SetLocal().("remote.bar.pushurl", "https://github.com/git-lfs/pktline.git")
784
785 expected := make(map[string][]string)
786 expected["foo"] = []string{"https://github.com/git-lfs/git-lfs.git"}
787 expected["bar"] = []string{"https://github.com/git-lfs/wildmatch.git"}
788 actual, err := RemoteURLsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/RemoteURLs().(false)
789 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Nilscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Nil().(t, err)
790 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, expected, actual)
791
792 expected["bar"] = []string{"https://github.com/git-lfs/pktline.git"}
793 actual, err = RemoteURLsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/RemoteURLs().(true)
794 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Nilscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Nil().(t, err)
795 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, expected, actual)
796 }
797
798 func TestMapRemoteURLscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git_test`/TestMapRemoteURL().(t *testingscip-go gomod github.com/golang/go/src go1.25.0 testing/.Tscip-go gomod github.com/golang/go/src go1.25.0 testing/T#) {
799 repo := testscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/.NewReposcip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/NewRepo().(t)
800 repo.Pushdscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/Repo#Pushd().()
801 defer func() {
802 repo.Popdscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/Repo#Popd().()
803 repo.Cleanupscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/Repo#Cleanup().()
804 }()
805 cfg := repo.GitConfigscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/t/cmd/util`/Repo#GitConfig().()
806 cfg.SetLocalscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Configuration#SetLocal().("remote.foo.url", "https://github.com/git-lfs/git-lfs.git")
807 cfg.SetLocalscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Configuration#SetLocal().("remote.bar.url", "https://github.com/git-lfs/wildmatch.git")
808 cfg.SetLocalscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Configuration#SetLocal().("remote.bar.pushurl", "https://github.com/git-lfs/pktline.git")
809
810 tests := []struct {
811 url string
812 push bool
813 match bool
814 val string
815 }{
816 {
817 "https://github.com/git-lfs/git-lfs.git",
818 false,
819 true,
820 "foo",
821 },
822 {
823 "https://github.com/git-lfs/git-lfs.git",
824 true,
825 true,
826 "foo",
827 },
828 {
829 "https://github.com/git-lfs/wildmatch.git",
830 false,
831 true,
832 "bar",
833 },
834 {
835 "https://github.com/git-lfs/pktline.git",
836 true,
837 true,
838 "bar",
839 },
840 {
841 "https://github.com/git-lfs/pktline.git",
842 false,
843 false,
844 "https://github.com/git-lfs/pktline.git",
845 },
846 {
847 "https://github.com/git/git.git",
848 true,
849 false,
850 "https://github.com/git/git.git",
851 },
852 }
853 for _, test := range tests {
854 val, ok := MapRemoteURLscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/MapRemoteURL().(test.url, test.push)
855 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, ok, test.match)
856 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, val, test.val)
857 }
858 }
859
860 func TestIsValidObjectIDLengthscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git_test`/TestIsValidObjectIDLength().(t *testingscip-go gomod github.com/golang/go/src go1.25.0 testing/.Tscip-go gomod github.com/golang/go/src go1.25.0 testing/T#) {
861 // Lengths are 40, 64, 39, and 12.
862 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, HasValidObjectIDLengthscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/HasValidObjectIDLength().("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), true)
863 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, HasValidObjectIDLengthscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/HasValidObjectIDLength().("2222222222222222222222222222222222222222222222222222222222222222"), true)
864 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, HasValidObjectIDLengthscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/HasValidObjectIDLength().("555555555555555555555555555555555555555"), false)
865 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, HasValidObjectIDLengthscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/HasValidObjectIDLength().("0123456789ab"), false)
866 }
867
868 func TestIsZeroObjectIDscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git_test`/TestIsZeroObjectID().(t *testingscip-go gomod github.com/golang/go/src go1.25.0 testing/.Tscip-go gomod github.com/golang/go/src go1.25.0 testing/T#) {
869 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, IsZeroObjectIDscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/IsZeroObjectID().("0000000000000000000000000000000000000000"), true)
870 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, IsZeroObjectIDscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/IsZeroObjectID().("0000000000000000000000000000000000000000000000000000000000000000"), true)
871 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, IsZeroObjectIDscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/IsZeroObjectID().("000000000000000000000000000000000000000"), false)
872 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, IsZeroObjectIDscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/IsZeroObjectID().("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"), false)
873 assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, IsZeroObjectIDscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/IsZeroObjectID().("473a0f4c3be8a93681a267e3b1e9a7dcda1185436fe141f7749120a303721813"), false)
874 }