MCPcopy Index your code
hub / github.com/git-bug/git-bug / BugSetTitle

Method BugSetTitle

api/graphql/resolvers/mutation.go:313–344  ·  view source on GitHub ↗
(ctx context.Context, input models.BugSetTitleInput)

Source from the content-addressed store, hash-verified

311}
312
313func (r mutationResolver) BugSetTitle(ctx context.Context, input models.BugSetTitleInput) (*models.BugSetTitlePayload, error) {
314 repo, b, err := r.getBug(input.RepoRef, input.Prefix)
315 if err != nil {
316 return nil, err
317 }
318
319 author, err := auth.UserFromCtx(ctx, repo)
320 if err != nil {
321 return nil, err
322 }
323
324 op, err := b.SetTitleRaw(
325 author,
326 time.Now().Unix(),
327 text.CleanupOneLine(input.Title),
328 nil,
329 )
330 if err != nil {
331 return nil, err
332 }
333
334 err = b.Commit()
335 if err != nil {
336 return nil, err
337 }
338
339 return &models.BugSetTitlePayload{
340 ClientMutationID: input.ClientMutationID,
341 Bug: models.NewLoadedBug(b.Snapshot()),
342 Operation: op,
343 }, nil
344}

Callers

nothing calls this directly

Calls 7

getBugMethod · 0.95
UserFromCtxFunction · 0.92
CleanupOneLineFunction · 0.92
NewLoadedBugFunction · 0.92
SetTitleRawMethod · 0.80
SnapshotMethod · 0.80
CommitMethod · 0.65

Tested by

no test coverage detected