1
1
mirror of https://gitea.com/gitea/tea synced 2026-07-26 11:11:03 +02:00
Files
Lunny Xiao 993eb37b57 Fix notifications --mine outside git repositories (#1056)
Fixes #1055.

## Root cause
`tea notifications --mine` still initialized full repository context before checking the global notification scope, so it probed the current working directory with git and could select or fail on repository-derived context even though repository data is not needed.

## Changes
- Add an InitCommand option to skip local git repository discovery when a command does not need repository context.
- Use that option for notification list and mark-as operations when `--mine` is set.
- Add a regression test that makes `git` fail if invoked and verifies `notifications --mine` still uses the global notifications API.

## Tests
- `go test ./cmd/notifications ./modules/context`

Reviewed-on: https://gitea.com/gitea/tea/pulls/1056
2026-07-26 01:37:33 +00:00
..
2026-06-26 21:40:31 +00:00
2026-05-26 21:14:47 +00:00
2023-09-08 01:40:02 +00:00
2026-04-29 15:04:55 +00:00
2026-06-26 21:40:31 +00:00
2026-05-26 21:14:47 +00:00