Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add reflog command #121

Merged
merged 6 commits into from
Jun 17, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
change scope of recType from private to public (#120)
JunNishimura committed Jun 15, 2023
commit 40ffb0f840971475187553190d0350370f1df7a4
12 changes: 7 additions & 5 deletions internal/log/logger.go
Original file line number Diff line number Diff line change
@@ -10,15 +10,17 @@ import (
"github.com/JunNishimura/Goit/internal/sha"
)

type recordType int
type RecordType int

const (
CommitRecord recordType = iota
UndefinedRecord RecordType = iota
CommitRecord
CheckoutRecord
BranchRecord
)

func (t recordType) String() string {

func (t RecordType) String() string {
switch t {
case CommitRecord:
return "commit"
@@ -32,7 +34,7 @@ func (t recordType) String() string {
}

type record struct {
recType recordType
recType RecordType
from sha.SHA1
to sha.SHA1
name string
@@ -42,7 +44,7 @@ type record struct {
message string
}

func NewRecord(recType recordType, from, to sha.SHA1, name, email string, t time.Time, message string) *record {
func NewRecord(recType RecordType, from, to sha.SHA1, name, email string, t time.Time, message string) *record {
unixtime := fmt.Sprint(t.Unix())
_, offset := t.Zone()
offsetMinutes := offset / 60
2 changes: 1 addition & 1 deletion internal/log/logger_test.go
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@ import (

func TestNewRecord(t *testing.T) {
type args struct {
recType recordType
recType RecordType
from sha.SHA1
to sha.SHA1
name string