Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'internal/git/log')
-rw-r--r--internal/git/log/commit.go4
-rw-r--r--internal/git/log/commit_test.go14
-rw-r--r--internal/git/log/tag.go8
-rw-r--r--internal/git/log/tag_test.go8
4 files changed, 28 insertions, 6 deletions
diff --git a/internal/git/log/commit.go b/internal/git/log/commit.go
index e0b7d30db..3fd7a4cfd 100644
--- a/internal/git/log/commit.go
+++ b/internal/git/log/commit.go
@@ -158,6 +158,10 @@ func parseCommitAuthor(line string) *gitalypb.CommitAuthor {
author.Date = &timestamp.Timestamp{Seconds: sec}
+ if len(secSplit) == 2 {
+ author.Timezone = []byte(secSplit[1])
+ }
+
return author
}
diff --git a/internal/git/log/commit_test.go b/internal/git/log/commit_test.go
index a70efdb36..120604859 100644
--- a/internal/git/log/commit_test.go
+++ b/internal/git/log/commit_test.go
@@ -71,9 +71,10 @@ func TestParseRawCommit(t *testing.T) {
out: &gitalypb.GitCommit{
Id: info.Oid,
Author: &gitalypb.CommitAuthor{
- Name: []byte("Jane Doe"),
- Email: []byte("janedoe@example.com"),
- Date: &timestamp.Timestamp{Seconds: 9223371974719179007},
+ Name: []byte("Jane Doe"),
+ Email: []byte("janedoe@example.com"),
+ Date: &timestamp.Timestamp{Seconds: 9223371974719179007},
+ Timezone: []byte("+0200"),
},
},
},
@@ -83,9 +84,10 @@ func TestParseRawCommit(t *testing.T) {
out: &gitalypb.GitCommit{
Id: info.Oid,
Author: &gitalypb.CommitAuthor{
- Name: []byte("Jane Doe"),
- Email: []byte("janedoe@example.com"),
- Date: &timestamp.Timestamp{Seconds: 9223371974719179007},
+ Name: []byte("Jane Doe"),
+ Email: []byte("janedoe@example.com"),
+ Date: &timestamp.Timestamp{Seconds: 9223371974719179007},
+ Timezone: []byte("+0200"),
},
},
},
diff --git a/internal/git/log/tag.go b/internal/git/log/tag.go
index fca94292d..52c340673 100644
--- a/internal/git/log/tag.go
+++ b/internal/git/log/tag.go
@@ -44,6 +44,8 @@ func GetTagCatfile(c *catfile.Batch, tagID, tagName string) (*gitalypb.Tag, erro
type tagHeader struct {
oid string
tagType string
+ tag string
+ tagger string
}
func splitRawTag(r io.Reader) (*tagHeader, []byte, error) {
@@ -75,6 +77,10 @@ func splitRawTag(r io.Reader) (*tagHeader, []byte, error) {
header.oid = value
case "type":
header.tagType = value
+ case "tag":
+ header.tag = value
+ case "tagger":
+ header.tagger = value
}
}
@@ -108,6 +114,8 @@ func buildAnnotatedTag(b *catfile.Batch, tagID, name string, header *tagHeader,
}
}
+ tag.Tagger = parseCommitAuthor(header.tagger)
+
return tag, nil
}
diff --git a/internal/git/log/tag_test.go b/internal/git/log/tag_test.go
index 13ef06166..daa8540b4 100644
--- a/internal/git/log/tag_test.go
+++ b/internal/git/log/tag_test.go
@@ -69,6 +69,8 @@ func TestSplitRawTag(t *testing.T) {
header: tagHeader{
oid: "c92faf3e0a557270141be67f206d7cdb99bfc3a2",
tagType: "commit",
+ tag: "v2.6.16.28",
+ tagger: "Adrian Bunk <bunk@stusta.de> 1156539089 +0200",
},
body: nil,
},
@@ -78,6 +80,8 @@ func TestSplitRawTag(t *testing.T) {
header: tagHeader{
oid: "c92faf3e0a557270141be67f206d7cdb99bfc3a2",
tagType: "commit",
+ tag: "v2.6.16.28",
+ tagger: "Adrian Bunk <bunk@stusta.de> 1156539089 +0200",
},
body: []byte("message"),
},
@@ -87,6 +91,8 @@ func TestSplitRawTag(t *testing.T) {
header: tagHeader{
oid: "c92faf3e0a557270141be67f206d7cdb99bfc3a2",
tagType: "commit",
+ tag: "v2.6.16.28",
+ tagger: "Adrian Bunk <bunk@stusta.de> 1156539089 +0200",
},
body: []byte{},
},
@@ -96,6 +102,8 @@ func TestSplitRawTag(t *testing.T) {
header: tagHeader{
oid: "c92faf3e0a557270141be67f206d7cdb99bfc3a2",
tagType: "commit",
+ tag: "v2.6.16.28",
+ tagger: "Adrian Bunk <bunk@stusta.de> 1156539089 +0200",
},
body: []byte("Hello world\n\nThis is a message"),
},