gitea.tea/modules
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
..
api fix(http): add transport timeouts so tea fails fast on stalled servers (#1020) 2026-06-26 19:59:05 +00:00
auth fix(http): add transport timeouts so tea fails fast on stalled servers (#1020) 2026-06-26 19:59:05 +00:00
config upgrade go sdk and add test (#1048) 2026-07-01 18:06:19 +00:00
context Fix notifications --mine outside git repositories (#1056) 2026-07-26 01:37:33 +00:00
debug add debug mode and update readme (#805) 2025-09-10 19:10:02 +00:00
filelock Move versions/filelocker into dedicated subpackages, and consistent headers in http requests (#888) 2026-02-05 18:05:43 +00:00
git Add reply to code review (#978) 2026-06-26 21:40:31 +00:00
httputil fix(http): add transport timeouts so tea fails fast on stalled servers (#1020) 2026-06-26 19:59:05 +00:00
interact feat(assignees): add set, add, and remove assignees APIs (#1045) 2026-07-18 00:20:03 +00:00
print fix(labels): add org label for ls and pr (#1017) 2026-06-24 17:46:12 +00:00
task feat(assignees): add set, add, and remove assignees APIs (#1045) 2026-07-18 00:20:03 +00:00
theme fix(theme): don't query the terminal at start-up (#1054) 2026-07-13 04:31:26 +00:00
utils feat(pulls): add --draft to create and --draft/--ready to edit (#1008) 2026-05-31 02:50:32 +00:00
version Move versions/filelocker into dedicated subpackages, and consistent headers in http requests (#888) 2026-02-05 18:05:43 +00:00