diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2026-02-10 13:10:18 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2026-02-10 13:10:18 +0000 |
| commit | 1e7aeb4d7972d29c6586df18128a8a4f7667845a (patch) | |
| tree | 0f7e5fcaa5a005aeec7ae2d9f35b2c473ef8f785 /test_utils/src/git.rs | |
| parent | d2412565334f48bd31e57d29d7959c24258ccd98 (diff) | |
| parent | aae452697d152694a8f163219f707356e84b420b (diff) | |
Make ngit non-interactive by default
Implements non-interactive mode as the default behavior for ngit.
Users must now use -i flag for interactive prompts, or provide
all required arguments explicitly. Adds -d flag for sensible
defaults and -f flag for force operations.
Changes:
- CLI interactor infrastructure supports non-interactive mode
- Global flags: -i (interactive), --defaults (use defaults), -f (force)
- ngit init: requires --name or --identifier, supports --defaults
- ngit account: new signup command, login supports non-interactive
- ngit send: validates required fields, supports --defaults
- git-remote-nostr: fixed to prevent interactive prompts during push
- Comprehensive test coverage: 234 unit tests + integration tests
Diffstat (limited to 'test_utils/src/git.rs')
| -rw-r--r-- | test_utils/src/git.rs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test_utils/src/git.rs b/test_utils/src/git.rs index ab21f38..a18f81c 100644 --- a/test_utils/src/git.rs +++ b/test_utils/src/git.rs | |||
| @@ -282,6 +282,30 @@ impl GitTestRepo { | |||
| 282 | branch.set_upstream(Some(&format!("origin/{branch_name}")))?; | 282 | branch.set_upstream(Some(&format!("origin/{branch_name}")))?; |
| 283 | self.checkout(branch_name) | 283 | self.checkout(branch_name) |
| 284 | } | 284 | } |
| 285 | |||
| 286 | /// Set nostr.repo git config to point to a specific pubkey's coordinate. | ||
| 287 | /// Used for State D/E tests where the coordinate points to another user. | ||
| 288 | pub fn set_nostr_repo_coordinate( | ||
| 289 | &self, | ||
| 290 | pubkey: &nostr::PublicKey, | ||
| 291 | identifier: &str, | ||
| 292 | relays: &[&str], | ||
| 293 | ) { | ||
| 294 | let relay_urls: Vec<nostr::RelayUrl> = relays | ||
| 295 | .iter() | ||
| 296 | .map(|r| nostr::RelayUrl::parse(r).unwrap()) | ||
| 297 | .collect(); | ||
| 298 | let coordinate = Nip19Coordinate { | ||
| 299 | coordinate: Coordinate::new(nostr::Kind::GitRepoAnnouncement, *pubkey) | ||
| 300 | .identifier(identifier.to_string()), | ||
| 301 | relays: relay_urls, | ||
| 302 | }; | ||
| 303 | let _ = self | ||
| 304 | .git_repo | ||
| 305 | .config() | ||
| 306 | .unwrap() | ||
| 307 | .set_str("nostr.repo", &coordinate.to_bech32().unwrap()); | ||
| 308 | } | ||
| 285 | } | 309 | } |
| 286 | 310 | ||
| 287 | impl Drop for GitTestRepo { | 311 | impl Drop for GitTestRepo { |