diff options
-rw-r--r-- | internal/git/decoder.go | 6 | ||||
-rw-r--r-- | internal/git/gitpipe/revision_test.go | 2 | ||||
-rw-r--r-- | internal/gitaly/service/ref/find_all_tags.go | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/internal/git/decoder.go b/internal/git/decoder.go index f73889ed2..e788dede9 100644 --- a/internal/git/decoder.go +++ b/internal/git/decoder.go @@ -24,18 +24,18 @@ func NewShowRefDecoder(r io.Reader) *RefsDecoder { // ForEachRefFormat can be passed to the `for-each-ref` `--format` flag // to retrieve references that can be parsed by `NewForEachRefDecoder`. -const ForEachRefFormat = "%(objectname)%00%(refname)" +const ForEachRefFormat = "%(objectname) %(refname)" // ForEachRefSymbolicFormat can be passed to the `for-each-ref` `--format` flag // to retrieve references that can be parsed by `NewForEachRefDecoder` and that // distinguishes symbolic references. -const ForEachRefSymbolicFormat = "%(objectname)%00%(refname)%00%(symref)" +const ForEachRefSymbolicFormat = "%(objectname) %(refname) %(symref)" // NewForEachRefDecoder ... func NewForEachRefDecoder(r io.Reader) *RefsDecoder { return &RefsDecoder{ r: bufio.NewReader(r), - sep: "\x00", + sep: " ", } } diff --git a/internal/git/gitpipe/revision_test.go b/internal/git/gitpipe/revision_test.go index b31d30ff7..8b0d7bd25 100644 --- a/internal/git/gitpipe/revision_test.go +++ b/internal/git/gitpipe/revision_test.go @@ -572,7 +572,7 @@ func TestForEachRef(t *testing.T) { t.Run("tag with format", func(t *testing.T) { refs := readRefs(t, repo, []string{"refs/tags/v1.0.0"}, - WithForEachRefFormat("%(objectname)%00tag\n%(*objectname)%00peeled"), + WithForEachRefFormat("%(objectname) tag\n%(*objectname) peeled"), ) require.Equal(t, refs, []RevisionResult{ diff --git a/internal/gitaly/service/ref/find_all_tags.go b/internal/gitaly/service/ref/find_all_tags.go index 23a925c04..849427c1b 100644 --- a/internal/gitaly/service/ref/find_all_tags.go +++ b/internal/gitaly/service/ref/find_all_tags.go @@ -50,7 +50,7 @@ func (s *server) findAllTags(ctx context.Context, repo *localrepo.Repo, sortFiel repo, []string{"refs/tags/"}, gitpipe.WithSortField(sortField), - gitpipe.WithForEachRefFormat("%(objectname)%00%(refname)%(if)%(*objectname)%(then)\n%(objectname)^{}%00peeled%(end)"), + gitpipe.WithForEachRefFormat("%(objectname) %(refname)%(if)%(*objectname)%(then)\n%(objectname)^{} peeled%(end)"), ) catfileObjectsIter := gitpipe.CatfileObject(ctx, objectReader, forEachRefIter) |