F1: remote checkout without a remote, git.lastMessage, shared git status store

- vcs: checking out a remote-tracking branch reads remote.<name>.fetch;
  without a matching refspec it creates the local branch with --no-track
  instead of leaving a dirty tree after git fails to set up tracking.
- vcs + engine: git.lastMessage returns HEAD's full message (null before
  the first commit); the Changes window prefills Amend with it.
- ui: stores/vcsStatus.ts is the only git.status caller; the Changes
  window, tree/tab colours and the branch item read its snapshot, so a
  gitChanged costs one status query. RepoSummary carries upstream,
  ahead and behind.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
danny 2026-10-27 17:16:53 +01:00
parent d567f3957d
commit 4bdfe521f2
14 changed files with 649 additions and 314 deletions

View file

@ -180,6 +180,13 @@ fn status_stage_commit_show_and_branches() {
assert_eq!(commit["summary"], "second");
assert_eq!(commit["commit"], git(dir.path(), &["rev-parse", "HEAD"]));
assert_eq!(host.git_changes().len(), 1);
assert_eq!(
host.run("git.lastMessage", Value::Null).unwrap(),
json!({"message": "second\n\nbody"})
);
assert!(host.git_changes().is_empty());
let err = host.run("git.lastMessage", json!([1])).unwrap_err();
assert_eq!(err.code(), "invalid_params");
assert_eq!(
host.run("git.status", Value::Null).unwrap()["files"],
json!([])