1

For example when we alter a document vscode.workspace.onDidChangeTextDocument gets triggered or when we go from one file to another vscode.window.onDidChangeActiveTextEditor gets triggered. Is there any command that gets triggered or any way to figure out whether the branch has been changed?

jonrsharpe
  • 115,751
  • 26
  • 228
  • 437
Sid
  • 137
  • 6

1 Answers1

1

See the git extension API type definitions file.

This API point in particular looks relevant to what you are looking for:

export interface RepositoryState {
    readonly HEAD: Branch | undefined;
    readonly refs: Ref[];
    readonly remotes: Remote[];
    readonly submodules: Submodule[];
    readonly rebaseCommit: Commit | undefined;

    readonly mergeChanges: Change[];
    readonly indexChanges: Change[];
    readonly workingTreeChanges: Change[];

    readonly onDidChange: Event<void>;
}

This isn't a full answer, but please edit it or create one if you know how to complete it.

starball
  • 20,030
  • 7
  • 43
  • 238