Apply suggestions from code review

Co-authored-by: lhchavez <lhchavez@lhchavez.com>
This commit is contained in:
Segev Finer 2020-11-13 16:52:55 +02:00 committed by GitHub
parent c58fb46e56
commit e69f003813
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 4 deletions

View File

@ -504,9 +504,6 @@ const (
// characters and collapsing runs of adjacent slashes between name components
// into a single slash.
//
// Once normalized, if the reference name is valid, it will be returned in the
// user allocated buffer.
//
// See git_reference_symbolic_create() for rules about valid names.
func ReferenceNormalizeName(name string, flags ReferenceFormat) (string, error) {
cname := C.CString(name)

View File

@ -231,7 +231,7 @@ func TestReferenceNormalizeName(t *testing.T) {
checkFatal(t, err)
if ref != "refs/heads/master" {
t.Errorf("refs/heads//master should be normalized correctly")
t.Errorf("ReferenceNormalizeName(%q) = %q; want %q", "refs/heads//master", ref, want)
}
ref, err = ReferenceNormalizeName("master", ReferenceFormatAllowOnelevel|ReferenceFormatRefspecShorthand)