internal/store/commitrefs.go

03fe6e44370f8129c9ac68f13fe674cc271f5ffa
gitbay/internal/store/commitrefs.go

15 lines · 497 bytes

 1package store
 2
 3// TryRecordCommitRef marks a commit as having referenced an issue. It
 4// reports whether this pair was new — false means the reference was
 5// already processed and must not act again.
 6func (s *Store) TryRecordCommitRef(issueID int64, sha string) (bool, error) {
 7	res, err := s.DB.Exec(
 8		"INSERT INTO issue_commit_refs (issue_id, sha) VALUES (?, ?) ON CONFLICT DO NOTHING",
 9		issueID, sha)
10	if err != nil {
11		return false, err
12	}
13	n, _ := res.RowsAffected()
14	return n > 0, nil
15}
Keyboard shortcuts

Global

⌘K
Command palette & jump
/
Focus search
?
Show this help
g d
Dashboard
g e
Explore repositories
g n
Notifications

Repository & editor

t
Find file in repository
y
Copy immutable SHA permalink
g c
Code tab
g i
Issues tab
g m
Merge requests tab
g b
Builds tab
⌘↵
Submit active form