(t *testing.T)
| 153 | } |
| 154 | |
| 155 | func TestUtil(t *testing.T) { |
| 156 | t.Parallel() |
| 157 | repo := createTestRepo(t) |
| 158 | defer cleanupTestRepo(t, repo) |
| 159 | |
| 160 | commitId, _ := seedTestRepo(t, repo) |
| 161 | |
| 162 | ref, err := repo.References.Create("refs/heads/foo", commitId, true, "") |
| 163 | checkFatal(t, err) |
| 164 | |
| 165 | ref2, err := repo.References.Dwim("foo") |
| 166 | checkFatal(t, err) |
| 167 | |
| 168 | if ref.Cmp(ref2) != 0 { |
| 169 | t.Fatalf("foo didn't dwim to the right thing") |
| 170 | } |
| 171 | |
| 172 | if ref.Shorthand() != "foo" { |
| 173 | t.Fatalf("refs/heads/foo has no foo shorthand") |
| 174 | } |
| 175 | |
| 176 | hasLog, err := repo.References.HasLog("refs/heads/foo") |
| 177 | checkFatal(t, err) |
| 178 | if !hasLog { |
| 179 | t.Fatalf("branches have logs by default") |
| 180 | } |
| 181 | } |
| 182 | |
| 183 | func TestIsNote(t *testing.T) { |
| 184 | t.Parallel() |
nothing calls this directly
no test coverage detected
searching dependent graphs…