@kubohiroya/turbowarp-plus-editor-git 0.16.1 → 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.ja.md +14 -0
- package/README.md +14 -0
- package/dist/filesystem.d.ts +2 -2
- package/dist/github-pull-requests.d.ts +20 -0
- package/dist/index.d.ts +3 -2
- package/dist/index.js +177 -14
- package/dist/local-operations.d.ts +8 -1
- package/dist/messages.d.ts +8 -0
- package/dist/{project-asset-paths-KV715791.js → project-asset-paths-nL5sV35A.js} +653 -1
- package/dist/{project-comparison-1rggIJse.js → project-comparison-DjMlwyp8.js} +10 -654
- package/dist/project-source-diff.js +2 -1
- package/dist/pull-request-panel.d.ts +25 -1
- package/dist/remote-operations.d.ts +23 -0
- package/dist/{repository-BYno-5f8.js → repository-xIv0iZkj.js} +346 -7
- package/dist/repository.d.ts +32 -0
- package/dist/repository.js +1 -1
- package/package.json +1 -1
- package/src/filesystem.ts +2 -1
- package/src/github-pull-requests.ts +7 -0
- package/src/index.tsx +31 -3
- package/src/local-operations.ts +23 -3
- package/src/messages.ts +8 -0
- package/src/pull-request-panel.tsx +125 -14
- package/src/remote-operations.ts +84 -3
- package/src/repository.ts +133 -1
- package/test/smart-http-fixture.js +20 -0
package/README.ja.md
CHANGED
|
@@ -41,6 +41,20 @@ receive-pack の POST ごとに UUID v4 を発行し、`Git-Push-Id` に設定
|
|
|
41
41
|
|
|
42
42
|
Editor のホストが接続設定を渡すと、ローカル Git パネルで、現在のブランチと既存の GitHub HTTPS リモート `origin` に対して fetch、fast-forward pull、push ができます。push には接続時の明示許可が必要です。fetch は Git のメタデータを更新します。pull は作品を停止し、作業ツリーがクリーンで通常の実行権限なしファイルだけを扱える場合に使えます。変更を一時領域に組み立て、ローカルの状態を再確認してから適用します。pull 後はパネルから作品を再読込できます。
|
|
43
43
|
|
|
44
|
+
### 接続を使って PR を読む
|
|
45
|
+
|
|
46
|
+
GitHub 接続が接続済みのとき、PR レビューは PR の中身を GitHub API ではなく同じ Git Smart HTTP の経路で読みます。非公開リポジトリの PR も読め、中身の取得には API の利用上限を使いません。`repository.fetchPullRequest(number, getSession, guard, signal)` は GitHub の `refs/pull/<番号>/head` を、すべてのブランチと一緒に fetch します(広告と pack の 2 件)。フォークからの PR も base のリポジトリのこの ref で取れます。ブランチは fetch と同じく `refs/remotes/origin/*` を更新します。`repository.readPullRequest(head, {sha, branch})` は、手元の Git オブジェクトから、ベースとの merge base と head を比べます。変更されたパス(内容が同じ移動は名前の変更として対にします)、`project.source.json` ごとのブロック差分、同じコミットから読むサムネイルを返します。プロキシの経路と GitHub App の権限は変えません。
|
|
47
|
+
|
|
48
|
+
取得した head は `refs/pull/origin/<番号>/head` に置き、同じ PR を取得するたびに置き換えます(head は force-push されることがあるため)。`refs/heads`・`refs/remotes`・`refs/tags` の外にあるので、Git CLI では `git for-each-ref refs/pull` と `git log --all` に出て、`git branch -a` と `git tag` には出ません。`refs/remotes/origin/` の下に置くと GitHub のブランチに見え、`git fetch --prune` で消えます。ref を作らずに取得すると、オブジェクトがどこからも参照されず `git gc` で消えます。要らなくなった ref は `git update-ref -d refs/pull/origin/<番号>/head` で消せます。取得で書くのはオブジェクトと ref だけで、fetch・pull と同じ一時領域とロック(`tw-plus-git-mutation`)を通します。作業ツリー、インデックス、HEAD、`.git/config` は書きません。
|
|
49
|
+
|
|
50
|
+
一覧と、公開リポジトリの題名・本文・ベースは、引き続き公開 API から読みます(PR ごとに 1 件)。API のベースのコミットが取得で手元に来ていればそれと比べ、なければベースのブランチと比べます。非公開リポジトリではベースのブランチが API でしかわからないため、GitHub の既定のブランチと比べ、別のブランチを選べるようにします。失敗したときは、未接続またはセッション切れ、接続にリポジトリを読む権限がない、その番号の PR がない、ネットワーク、のどれかを示します。接続しているときに中身を公開 API から読むことはありません。接続していないときは、従来どおり公開 API を読みます。選んだブランチにすでにマージされた PR は、API がベースのコミットを返さない限り、変更なしと表示されます。
|
|
51
|
+
|
|
52
|
+
#### PR の版を手元で動かす
|
|
53
|
+
|
|
54
|
+
`localWrite` があるとき、接続で読んだ PR に「pr/<番号> として手元で開く」が出ます。取得した head にローカルブランチ `pr/<番号>` を作り(`pullRequestBranch(number)`。`refs/pull/origin/<番号>/head` はそのまま残します)、ブランチ一覧と同じ確認付きの経路で切り替え、選んでいる作品フォルダをそのブランチから開き直します。これで PR の版を Editor で実行できます。作品の実行中、Editor に保存していない編集があるとき、作業ツリーに変更(ステージ済み・未ステージ・未追跡)があるときは行わず、何も書きません。開いている作品フォルダが PR にないときは、先に確かめます。`pr/<番号>` がすでに同じコミットにあるときは、それに切り替えます。別のコミットを指しているとき(そのブランチで記録した、または PR が更新された)は、ブランチを動かさずに断ります。「ローカルの変更」でそのブランチに切り替えるか、Git で名前を変えるか消して(`git branch -m pr/<番号> <名前>`、`git branch -D pr/<番号>`)、もう一度開いてください。公開 API で読んだ PR は Git のオブジェクトが手元にないため、ボタンを出しません。`localWrite` がないときも出しません。
|
|
55
|
+
|
|
56
|
+
元のブランチはそのまま残ります。戻るときは「ローカルの変更」でそのブランチに切り替えます(開いた後に、パネルがブランチ名を示します)。`pr/<番号>` は追跡の設定を持たない通常のローカルブランチです。パネルは消さず、pull と push もほかのブランチと同じに扱うので、意図しない限り push しないでください。要らなくなったら `git branch -D pr/<番号>` で消せます。
|
|
57
|
+
|
|
44
58
|
## 作品ソースのブロック差分
|
|
45
59
|
|
|
46
60
|
`@kubohiroya/turbowarp-plus-editor-git/project-source-diff` の `createProjectSourceDiff` に、変更前後の `project.source.json` の文字列を渡します。戻り値を `project.diff` として保存できます。生成した unified diff には全行の文脈が入るので、ビューへ渡すときは `.diff` だけで変更前後を復元できます。既存のコンパクトな Git 差分を使う場合は、`beforeSource` に対応する変更前の JSON も渡します。
|
package/README.md
CHANGED
|
@@ -41,6 +41,20 @@ Each receive-pack POST carries a new UUID v4 in `Git-Push-Id`. A browser replay
|
|
|
41
41
|
|
|
42
42
|
When the Editor host supplies connection settings, the Local Git panel offers fetch, fast-forward pull and push for the current branch and its existing GitHub HTTPS `origin`. Authorize push when connecting to enable the explicit push action. Fetch updates Git metadata. Pull requires a stopped project, a clean worktree, and regular non-executable files. Pull stages the changes, rechecks the local state, and then applies them. Reopen the project from the panel after a successful pull.
|
|
43
43
|
|
|
44
|
+
### Pull requests over the connection
|
|
45
|
+
|
|
46
|
+
While the connection is connected, the pull request review reads a pull request's contents over the same Git Smart HTTP route instead of the GitHub API, so private repositories work and the API rate limit is not used for contents. `repository.fetchPullRequest(number, getSession, guard, signal)` fetches GitHub's `refs/pull/<number>/head`, which the base repository also exposes for pull requests from forks, together with every branch (two requests: one advertisement and one pack). The branches update `refs/remotes/origin/*` as fetch does. `repository.readPullRequest(head, {sha, branch})` then compares the head with its merge base against the base, from local Git objects: the changed paths (with exact renames paired), each `project.source.json` as a block diff, and thumbnails from the same commits. The proxy routes and the GitHub App permissions are unchanged.
|
|
47
|
+
|
|
48
|
+
The fetched head is kept at `refs/pull/origin/<number>/head`, replaced on each fetch of that pull request (heads can be force-pushed). Outside `refs/heads`, `refs/remotes` and `refs/tags`, Git CLI shows it in `git for-each-ref refs/pull` and `git log --all` but not in `git branch -a` or `git tag`; `git fetch --prune` does not remove it, unlike a ref under `refs/remotes/origin/`, which would also read as a branch on GitHub; and `git gc` keeps its objects, which a fetch without a ref would leave unreachable. Remove the refs with `git update-ref -d refs/pull/origin/<number>/head` when they are no longer needed. The fetch writes only objects and refs through the same staging and lock (`tw-plus-git-mutation`) as fetch and pull, never the work tree, the index, HEAD or `.git/config`.
|
|
49
|
+
|
|
50
|
+
The public API still provides the list, and the title, description and base of public repositories (one request per pull request). Its base commit is compared when the fetch brought it, else the base branch. For a private repository the panel compares with GitHub's default branch and lets the person choose another branch, since the base branch is only known to the API. Failures name the cause: no connection or an expired session, a connection without access to the repository, a number with no pull request, or the network. The contents are never read from the public API while the connection is connected; without a connection, the review reads the public API as before. A pull request already merged into the chosen branch shows no changes unless the API gave its base commit.
|
|
51
|
+
|
|
52
|
+
#### Running a pull request locally
|
|
53
|
+
|
|
54
|
+
With `localWrite`, a pull request read over the connection offers **Open here as pr/<number>**. It creates the local branch `pr/<number>` at the fetched head (`pullRequestBranch(number)`; `refs/pull/origin/<number>/head` stays as it is), switches to it through the same checked path as the branch list, and opens the selected project folder again from it, so the pull request's version can be run in the Editor. It is refused, and nothing is written, while the project runs, while the Editor has unsaved edits, or while the work tree has changes (staged, unstaged or untracked). It asks first when the open project folder is not in the pull request. If `pr/<number>` already exists at the same commit, the panel switches to it; if it points at another commit (you recorded on it, or the pull request moved), the panel refuses and leaves the branch unchanged. Switch to it from **Local changes**, or rename or delete it with Git (`git branch -m pr/<number> <name>`, `git branch -D pr/<number>`), and open the pull request again. The button is not shown for pull requests read from the public API, which brings no Git objects, nor without `localWrite`.
|
|
55
|
+
|
|
56
|
+
The branch you were on stays as it was. To go back, switch to it under **Local changes** (the panel names it after opening). `pr/<number>` is an ordinary local branch without tracking settings: the panel does not delete it, and pull and push treat it like any other branch, so do not push it unless you mean to. Delete it with `git branch -D pr/<number>` when it is no longer needed.
|
|
57
|
+
|
|
44
58
|
## Comparing before choosing
|
|
45
59
|
|
|
46
60
|
`openProjectComparison(document, options)` lays several titled comparisons of `project.source.json` texts in one modal and asks the user to choose an action. Each of `sections` takes the same `before` and `after` as `ProjectSourceComparison`. The promise resolves with the chosen action's `id`, or with `null` when the dialog is closed or Escape is pressed. The first action receives focus, so list the one that loses the least first. The project folder uses it to show "Your unsaved edits" next to "Changes in the folder" before replacing unsaved edits.
|
package/dist/filesystem.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare class GitPanelError extends Error {
|
|
2
|
-
code: 'invalid' | 'changed' | 'large' | 'unsupported' | 'pullUnsafe' | 'diverged' | 'session' | 'pushUnknown' | 'pushRefresh' | 'rollbackFailed' | 'remoteFailed' | 'saveFirst' | 'author' | 'nothingStaged' | 'commitMessage' | 'switchUnsafe' | 'branchExists' | 'branchName' | 'locked';
|
|
3
|
-
constructor(code: 'invalid' | 'changed' | 'large' | 'unsupported' | 'pullUnsafe' | 'diverged' | 'session' | 'pushUnknown' | 'pushRefresh' | 'rollbackFailed' | 'remoteFailed' | 'saveFirst' | 'author' | 'nothingStaged' | 'commitMessage' | 'switchUnsafe' | 'branchExists' | 'branchName' | 'locked', message?: string);
|
|
2
|
+
code: 'invalid' | 'changed' | 'large' | 'unsupported' | 'pullUnsafe' | 'diverged' | 'session' | 'pushUnknown' | 'pushRefresh' | 'rollbackFailed' | 'remoteFailed' | 'saveFirst' | 'author' | 'nothingStaged' | 'commitMessage' | 'switchUnsafe' | 'branchExists' | 'branchConflict' | 'pullRequestBranch' | 'branchName' | 'locked' | 'pullRequestNotFound' | 'forbidden' | 'network' | 'baseMissing';
|
|
3
|
+
constructor(code: 'invalid' | 'changed' | 'large' | 'unsupported' | 'pullUnsafe' | 'diverged' | 'session' | 'pushUnknown' | 'pushRefresh' | 'rollbackFailed' | 'remoteFailed' | 'saveFirst' | 'author' | 'nothingStaged' | 'commitMessage' | 'switchUnsafe' | 'branchExists' | 'branchConflict' | 'pullRequestBranch' | 'branchName' | 'locked' | 'pullRequestNotFound' | 'forbidden' | 'network' | 'baseMissing', message?: string);
|
|
4
4
|
}
|
|
5
5
|
export declare const fileError: (code: string, path: string) => Error & {
|
|
6
6
|
code: string;
|
|
@@ -6,6 +6,26 @@ export declare class PullRequestError extends Error {
|
|
|
6
6
|
}
|
|
7
7
|
export declare function gitHubRepositoryFromOrigin(origin: string | undefined): string | null;
|
|
8
8
|
export declare function createGitHubPullRequests(repository: string, send?: typeof fetch): {
|
|
9
|
+
/** Reads one pull request's title, description, state and both revisions, without its files (one request). */
|
|
10
|
+
metadata(number: number, signal: AbortSignal): Promise<{
|
|
11
|
+
url: string;
|
|
12
|
+
author: string | undefined;
|
|
13
|
+
description: string;
|
|
14
|
+
base: {
|
|
15
|
+
sha: string;
|
|
16
|
+
ref: string;
|
|
17
|
+
repository: string | null;
|
|
18
|
+
};
|
|
19
|
+
head: {
|
|
20
|
+
sha: string;
|
|
21
|
+
ref: string;
|
|
22
|
+
repository: string | null;
|
|
23
|
+
};
|
|
24
|
+
state: "open" | "closed" | "merged" | "draft";
|
|
25
|
+
changedFiles: number;
|
|
26
|
+
number: number;
|
|
27
|
+
title: string;
|
|
28
|
+
}>;
|
|
9
29
|
list(page: number, signal: AbortSignal): Promise<{
|
|
10
30
|
items: {
|
|
11
31
|
number: number;
|
package/dist/index.d.ts
CHANGED
|
@@ -6,17 +6,18 @@ export { createScratchBlocksDiffLocator } from './block-diff-location.js';
|
|
|
6
6
|
export { createEditorBlockLocator } from './editor-block-locator.js';
|
|
7
7
|
export { createScratchBlocksDiffRenderer } from './scratch-block-diff-renderer.js';
|
|
8
8
|
export type { ScratchBlockDiffRendererOptions, ScratchBlocksPort } from './scratch-block-diff-renderer.js';
|
|
9
|
-
export { openRepository, createReadOnlyFs, GitPanelError } from './repository.js';
|
|
9
|
+
export { openRepository, createReadOnlyFs, GitPanelError, pullRequestRef } from './repository.js';
|
|
10
10
|
export { openProjectComparison } from './project-comparison.js';
|
|
11
11
|
export { openProjectSourceTabs } from './project-source-tabs.js';
|
|
12
12
|
export type { ProjectSourceTabsFile, ProjectSourceTabsOptions } from './project-source-tabs.js';
|
|
13
13
|
export type { ProjectComparisonAction, ProjectComparisonOptions, ProjectComparisonSection } from './project-comparison.js';
|
|
14
|
-
export type { Repository, Snapshot, FileChange, FileDiff, HistoryCommit, HistoryCursor, HistoryPage, HistoryRef } from './repository.js';
|
|
14
|
+
export type { PullRequestBase, PullRequestFetch, PullRequestFiles, Repository, Snapshot, FileChange, FileDiff, HistoryCommit, HistoryCursor, HistoryPage, HistoryRef } from './repository.js';
|
|
15
15
|
export { HistoryGraph, laneColors } from './history-graph-view.js';
|
|
16
16
|
export type { HistoryActionResult, HistoryGraphProps } from './history-graph-view.js';
|
|
17
17
|
export { layoutHistory } from './history-graph.js';
|
|
18
18
|
export type { GraphCommit, GraphLayout, GraphRow, GraphSegment } from './history-graph.js';
|
|
19
19
|
export type { GitAuthor, LocalOperation } from './local-operations.js';
|
|
20
|
+
export { pullRequestBranch } from './local-operations.js';
|
|
20
21
|
export interface GitHost {
|
|
21
22
|
connectionSettings?: GitConnectionSettings;
|
|
22
23
|
renderReviewBlock?: ProjectBlockRenderer;
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as openProjectSourceTabs, b as useCostumeImage, c as gitHubRepositoryFromOrigin, f as organizeProjectChanges, i as createScratchBlocksDiffLocator, l as ProjectSourceComparison, n as openProjectComparison, o as PullRequestError, p as projectPropertyLabel, r as createScratchBlocksDiffRenderer, s as createGitHubPullRequests, u as ProjectSourceReview, x as CloseButton, y as useAssetImage } from "./project-comparison-DjMlwyp8.js";
|
|
2
2
|
import { n as init_objectSpread2, r as __commonJSMin, t as _objectSpread2$1 } from "./objectSpread2-Dkd68nJH.js";
|
|
3
|
-
import {
|
|
3
|
+
import { l as parseProjectSource, u as readProjectSourceDiff } from "./project-asset-paths-nL5sV35A.js";
|
|
4
|
+
import { a as pullRequestRef, i as pullRequestBranch, n as openRepository, o as GitPanelError, s as createReadOnlyFs } from "./repository-xIv0iZkj.js";
|
|
4
5
|
import * as m from "react";
|
|
5
6
|
import React, { createContext, memo, useCallback, useContext, useEffect, useMemo, useRef, useState } from "react";
|
|
6
7
|
import { createPortal, render, unmountComponentAtNode } from "react-dom";
|
|
@@ -3150,6 +3151,10 @@ var messages = {
|
|
|
3150
3151
|
commitMessage: "Write a message for this record.",
|
|
3151
3152
|
switchUnsafe: "Stop the project, and save or record (or undo) every change, before switching branches.",
|
|
3152
3153
|
branchExists: "A branch with this name already exists.",
|
|
3154
|
+
branchConflict: "This name clashes with an existing branch: Git cannot keep both a branch and another branch under its name followed by /, such as pr and pr/7. Rename or delete the other branch with Git, or choose another name.",
|
|
3155
|
+
pullRequestBranch: "The branch pr/<number> already exists with other records, so this version was not opened. The branch is left unchanged. Switch to it in Local changes, or rename or delete it with Git, then open the pull request here again.",
|
|
3156
|
+
openedPullRequest: "Opened pull request #{number} on the local branch {branch}. To go back, switch to {previous} in Local changes.",
|
|
3157
|
+
openedPullRequestDetached: "Opened pull request #{number} on the local branch {branch}. To go back, switch to another branch in Local changes.",
|
|
3153
3158
|
locked: "Another Git tool is working on this repository (a lock file, or a merge, cherry-pick, revert or rebase in progress). Try again after it finishes.",
|
|
3154
3159
|
branchName: "Git cannot use this name for a branch.",
|
|
3155
3160
|
pullUnsafe: "Stop the project, and save or undo unsaved edits and unrecorded changes, before getting changes from GitHub (pull).",
|
|
@@ -3258,6 +3263,10 @@ var messages = {
|
|
|
3258
3263
|
commitMessage: "この記録の説明を書いてください。",
|
|
3259
3264
|
switchUnsafe: "ブランチを切り替える前に、実行を止め、すべての変更を保存して記録(または取り消し)してください。",
|
|
3260
3265
|
branchExists: "同じ名前のブランチがすでにあります。",
|
|
3266
|
+
branchConflict: "この名前は既存のブランチとぶつかります。Git では、pr と pr/7 のように、あるブランチと、その名前に / を続けたブランチを両方は持てません。Git でもう一方の名前を変えるか消すか、別の名前にしてください。",
|
|
3267
|
+
pullRequestBranch: "ブランチ pr/<番号> が、別の記録を指してすでにあるため、この版を開きませんでした。ブランチはそのままです。「ローカルの変更」で切り替えるか、Git で名前を変えるか消してから、もう一度ここで開いてください。",
|
|
3268
|
+
openedPullRequest: "プルリクエスト #{number} を、ローカルブランチ {branch} で開きました。戻るときは「ローカルの変更」で {previous} に切り替えてください。",
|
|
3269
|
+
openedPullRequestDetached: "プルリクエスト #{number} を、ローカルブランチ {branch} で開きました。戻るときは「ローカルの変更」で別のブランチに切り替えてください。",
|
|
3261
3270
|
locked: "ほかの Git の操作が、このリポジトリを使っています(ロックファイル、またはマージ・cherry-pick・revert・rebase の途中)。終わってから、もう一度試してください。",
|
|
3262
3271
|
branchName: "この名前は Git のブランチ名に使えません。",
|
|
3263
3272
|
pullUnsafe: "GitHub から取り込む前に、実行を止め、保存していない編集とまだ記録していない変更をなくしてください。",
|
|
@@ -3812,7 +3821,20 @@ var en = {
|
|
|
3812
3821
|
failed: "Could not read GitHub. Try again.",
|
|
3813
3822
|
changed: "The pull request changed while it was being read. Open it again.",
|
|
3814
3823
|
tooManyFiles: "GitHub only returns the first 3,000 changed files. This pull request exceeds that limit.",
|
|
3815
|
-
openTabs: "Open as tabs"
|
|
3824
|
+
openTabs: "Open as tabs",
|
|
3825
|
+
session: "Connect to GitHub again (GitHub connection) to read this pull request.",
|
|
3826
|
+
forbidden: "The GitHub connection is not allowed to read this repository.",
|
|
3827
|
+
pullRequestNotFound: "This repository has no pull request with this number.",
|
|
3828
|
+
network: "Could not reach GitHub through the connection. Check the network and try again.",
|
|
3829
|
+
remoteFailed: "Could not read the pull request through the GitHub connection. Try again.",
|
|
3830
|
+
baseMissing: "The base branch is not on GitHub. Choose another base branch.",
|
|
3831
|
+
viaConnection: "Read through the GitHub connection.",
|
|
3832
|
+
listPrivate: "The list uses the public GitHub API. Enter a pull request number to read it through the connection.",
|
|
3833
|
+
noMetadata: "The title and base branch are not available without the public GitHub API. Choose the base branch to compare with.",
|
|
3834
|
+
base: "Base branch",
|
|
3835
|
+
pullRequest: "Pull request",
|
|
3836
|
+
openLocally: "Open here as {branch}",
|
|
3837
|
+
openLocallyHint: "Creates the local branch {branch} at this version, switches to it and opens the project, so it can be run. Unsaved edits and unrecorded changes stop it. Switch back in Local changes."
|
|
3816
3838
|
};
|
|
3817
3839
|
var ja = {
|
|
3818
3840
|
title: "プルリクエスト",
|
|
@@ -3834,12 +3856,40 @@ var ja = {
|
|
|
3834
3856
|
failed: "GitHub から取得できませんでした。再試行してください。",
|
|
3835
3857
|
changed: "取得中にプルリクエストが更新されました。もう一度開いてください。",
|
|
3836
3858
|
tooManyFiles: "変更ファイルが GitHub API の取得上限である 3,000 件を超えています。",
|
|
3837
|
-
openTabs: "タブで開く"
|
|
3859
|
+
openTabs: "タブで開く",
|
|
3860
|
+
session: "この PR を読むには、GitHub 接続でもう一度接続してください。",
|
|
3861
|
+
forbidden: "GitHub 接続に、このリポジトリを読む権限がありません。",
|
|
3862
|
+
pullRequestNotFound: "このリポジトリに、この番号のプルリクエストはありません。",
|
|
3863
|
+
network: "GitHub 接続で GitHub に届きませんでした。ネットワークを確認して、もう一度試してください。",
|
|
3864
|
+
remoteFailed: "GitHub 接続でプルリクエストを読めませんでした。もう一度試してください。",
|
|
3865
|
+
baseMissing: "ベースのブランチが GitHub にありません。別のベースを選んでください。",
|
|
3866
|
+
viaConnection: "GitHub 接続で取得しました。",
|
|
3867
|
+
listPrivate: "一覧は公開 GitHub API を使います。番号を入れると、GitHub 接続で読みます。",
|
|
3868
|
+
noMetadata: "公開 GitHub API を使えないため、題名とベースのブランチがわかりません。比べるベースのブランチを選んでください。",
|
|
3869
|
+
base: "ベースのブランチ",
|
|
3870
|
+
pullRequest: "プルリクエスト",
|
|
3871
|
+
openLocally: "{branch} として手元で開く",
|
|
3872
|
+
openLocallyHint: "この版にローカルブランチ {branch} を作って切り替え、作品を開き直して実行できるようにします。保存していない編集や記録していない変更があるときは行いません。元に戻すときは「ローカルの変更」で切り替えてください。"
|
|
3838
3873
|
};
|
|
3874
|
+
var gitErrors = [
|
|
3875
|
+
"session",
|
|
3876
|
+
"forbidden",
|
|
3877
|
+
"pullRequestNotFound",
|
|
3878
|
+
"network",
|
|
3879
|
+
"remoteFailed",
|
|
3880
|
+
"baseMissing",
|
|
3881
|
+
"changed"
|
|
3882
|
+
];
|
|
3839
3883
|
function errorMessage(error, labels) {
|
|
3840
|
-
|
|
3884
|
+
if (error instanceof PullRequestError) return labels[error.code];
|
|
3885
|
+
if (error instanceof GitPanelError) {
|
|
3886
|
+
const code = gitErrors.find((code) => code === error.code);
|
|
3887
|
+
return code ? labels[code] : labels.failed;
|
|
3888
|
+
}
|
|
3889
|
+
return labels.failed;
|
|
3841
3890
|
}
|
|
3842
|
-
function PullRequests({ name, labels, locale, renderBlock, locateFor, openTabs }) {
|
|
3891
|
+
function PullRequests({ name, labels, locale, renderBlock, locateFor, openTabs, repository, connection, openLocally }) {
|
|
3892
|
+
var _pr$base$ref, _pr$git, _pr$base$ref2;
|
|
3843
3893
|
const client = useMemo(() => createGitHubPullRequests(name), [name]);
|
|
3844
3894
|
const [page, setPage] = useState(1);
|
|
3845
3895
|
const [listing, setListing] = useState();
|
|
@@ -3847,10 +3897,12 @@ function PullRequests({ name, labels, locale, renderBlock, locateFor, openTabs }
|
|
|
3847
3897
|
const [selection, setSelection] = useState();
|
|
3848
3898
|
const [loaded, setLoaded] = useState();
|
|
3849
3899
|
const list = (listing === null || listing === void 0 ? void 0 : listing.page) === page ? listing.result : void 0;
|
|
3900
|
+
const [listConnected, setListConnected] = useState(false);
|
|
3850
3901
|
const detail = (loaded === null || loaded === void 0 ? void 0 : loaded.selection) === selection ? loaded === null || loaded === void 0 ? void 0 : loaded.result : void 0;
|
|
3851
3902
|
useEffect(() => {
|
|
3852
3903
|
const controller = new AbortController();
|
|
3853
3904
|
setListing(void 0);
|
|
3905
|
+
setListConnected(!!(connection === null || connection === void 0 ? void 0 : connection.connected()));
|
|
3854
3906
|
client.list(page, controller.signal).then((data) => {
|
|
3855
3907
|
if (!controller.signal.aborted) setListing({
|
|
3856
3908
|
page,
|
|
@@ -3871,7 +3923,8 @@ function PullRequests({ name, labels, locale, renderBlock, locateFor, openTabs }
|
|
|
3871
3923
|
useEffect(() => {
|
|
3872
3924
|
if (!selection) return;
|
|
3873
3925
|
const controller = new AbortController();
|
|
3874
|
-
|
|
3926
|
+
const load = () => (connection === null || connection === void 0 ? void 0 : connection.connected()) ? loadThroughConnection(selection.number, selection.base, controller.signal) : client.load(selection.number, controller.signal);
|
|
3927
|
+
load().then((data) => {
|
|
3875
3928
|
if (!controller.signal.aborted) setLoaded({
|
|
3876
3929
|
selection,
|
|
3877
3930
|
result: { data }
|
|
@@ -3888,6 +3941,56 @@ function PullRequests({ name, labels, locale, renderBlock, locateFor, openTabs }
|
|
|
3888
3941
|
selection,
|
|
3889
3942
|
labels
|
|
3890
3943
|
]);
|
|
3944
|
+
const fetched = useRef();
|
|
3945
|
+
/**
|
|
3946
|
+
* Fetches `refs/pull/<number>/head` and the branches over Git Smart HTTP and compares them from local objects. The
|
|
3947
|
+
* public API only adds the title, description and base when it can read the repository; the contents never come
|
|
3948
|
+
* from it, so a private repository is read only through the connection.
|
|
3949
|
+
*/
|
|
3950
|
+
const loadThroughConnection = async (number, chosenBase, signal) => {
|
|
3951
|
+
var _fetched$current, _ref, _ref2, _metadata$title, _metadata$description, _metadata$head$ref;
|
|
3952
|
+
const guard = () => {
|
|
3953
|
+
if (signal.aborted) throw new GitPanelError("changed");
|
|
3954
|
+
};
|
|
3955
|
+
let head, branches, defaultBranch, metadata = null;
|
|
3956
|
+
if (chosenBase !== void 0 && ((_fetched$current = fetched.current) === null || _fetched$current === void 0 ? void 0 : _fetched$current.number) === number) ({head, branches, defaultBranch} = fetched.current);
|
|
3957
|
+
else {
|
|
3958
|
+
metadata = await client.metadata(number, signal).catch((error) => {
|
|
3959
|
+
if (signal.aborted) throw error;
|
|
3960
|
+
return null;
|
|
3961
|
+
});
|
|
3962
|
+
const result = await repository.fetchPullRequest(number, connection.getSession, guard, signal);
|
|
3963
|
+
if (metadata && metadata.head.sha !== result.head) throw new PullRequestError("changed");
|
|
3964
|
+
({head, branches, defaultBranch} = result);
|
|
3965
|
+
fetched.current = {
|
|
3966
|
+
number,
|
|
3967
|
+
head,
|
|
3968
|
+
branches,
|
|
3969
|
+
defaultBranch
|
|
3970
|
+
};
|
|
3971
|
+
}
|
|
3972
|
+
const branch = (_ref = (_ref2 = chosenBase !== null && chosenBase !== void 0 ? chosenBase : metadata === null || metadata === void 0 ? void 0 : metadata.base.ref) !== null && _ref2 !== void 0 ? _ref2 : defaultBranch) !== null && _ref !== void 0 ? _ref : branches[0];
|
|
3973
|
+
const read = await repository.readPullRequest(head, {
|
|
3974
|
+
sha: metadata === null || metadata === void 0 ? void 0 : metadata.base.sha,
|
|
3975
|
+
branch
|
|
3976
|
+
});
|
|
3977
|
+
guard();
|
|
3978
|
+
return {
|
|
3979
|
+
number,
|
|
3980
|
+
title: (_metadata$title = metadata === null || metadata === void 0 ? void 0 : metadata.title) !== null && _metadata$title !== void 0 ? _metadata$title : `${labels.pullRequest} #${number}`,
|
|
3981
|
+
description: (_metadata$description = metadata === null || metadata === void 0 ? void 0 : metadata.description) !== null && _metadata$description !== void 0 ? _metadata$description : "",
|
|
3982
|
+
author: metadata === null || metadata === void 0 ? void 0 : metadata.author,
|
|
3983
|
+
state: metadata === null || metadata === void 0 ? void 0 : metadata.state,
|
|
3984
|
+
head: {
|
|
3985
|
+
sha: head,
|
|
3986
|
+
ref: (_metadata$head$ref = metadata === null || metadata === void 0 ? void 0 : metadata.head.ref) !== null && _metadata$head$ref !== void 0 ? _metadata$head$ref : `pull/${number}/head`
|
|
3987
|
+
},
|
|
3988
|
+
base: read.base,
|
|
3989
|
+
files: read.files,
|
|
3990
|
+
url: "https://github.com/" + name + "/pull/" + number,
|
|
3991
|
+
git: { branches: metadata ? null : branches }
|
|
3992
|
+
};
|
|
3993
|
+
};
|
|
3891
3994
|
const choose = (number) => {
|
|
3892
3995
|
if (!Number.isSafeInteger(number) || number < 1) return;
|
|
3893
3996
|
setSelection({ number });
|
|
@@ -3907,7 +4010,7 @@ function PullRequests({ name, labels, locale, renderBlock, locateFor, openTabs }
|
|
|
3907
4010
|
max: Number.MAX_SAFE_INTEGER,
|
|
3908
4011
|
value: input,
|
|
3909
4012
|
onChange: (event) => setInput(event.currentTarget.value)
|
|
3910
|
-
})), /* @__PURE__ */ React.createElement("button", { type: "submit" }, labels.openNumber)), !list && /* @__PURE__ */ React.createElement("p", { role: "status" }, labels.loading), (list === null || list === void 0 ? void 0 : list.error) && /* @__PURE__ */ React.createElement("p", { role: "alert" }, list.error), (list === null || list === void 0 ? void 0 : list.data) && /* @__PURE__ */ React.createElement(React.Fragment, null, !list.data.items.length && /* @__PURE__ */ React.createElement("p", null, labels.empty), /* @__PURE__ */ React.createElement("ul", null, list.data.items.map((item) => /* @__PURE__ */ React.createElement("li", { key: item.number }, /* @__PURE__ */ React.createElement("button", {
|
|
4013
|
+
})), /* @__PURE__ */ React.createElement("button", { type: "submit" }, labels.openNumber)), !list && /* @__PURE__ */ React.createElement("p", { role: "status" }, labels.loading), (list === null || list === void 0 ? void 0 : list.error) && (listConnected && list.error === labels.unavailable ? /* @__PURE__ */ React.createElement("p", { role: "status" }, labels.listPrivate) : /* @__PURE__ */ React.createElement("p", { role: "alert" }, list.error)), (list === null || list === void 0 ? void 0 : list.data) && /* @__PURE__ */ React.createElement(React.Fragment, null, !list.data.items.length && /* @__PURE__ */ React.createElement("p", null, labels.empty), /* @__PURE__ */ React.createElement("ul", null, list.data.items.map((item) => /* @__PURE__ */ React.createElement("li", { key: item.number }, /* @__PURE__ */ React.createElement("button", {
|
|
3911
4014
|
className: "twgit-file",
|
|
3912
4015
|
type: "button",
|
|
3913
4016
|
"aria-pressed": (selection === null || selection === void 0 ? void 0 : selection.number) === item.number,
|
|
@@ -3920,7 +4023,17 @@ function PullRequests({ name, labels, locale, renderBlock, locateFor, openTabs }
|
|
|
3920
4023
|
type: "button",
|
|
3921
4024
|
disabled: !list.data.more,
|
|
3922
4025
|
onClick: () => setPage(page + 1)
|
|
3923
|
-
}, labels.next)))), /* @__PURE__ */ React.createElement("main", { className: "twgit-diff" }, !selection && /* @__PURE__ */ React.createElement("p", null, labels.select), selection && !detail && /* @__PURE__ */ React.createElement("p", { role: "status" }, labels.loading), (detail === null || detail === void 0 ? void 0 : detail.error) && /* @__PURE__ */ React.createElement("p", { role: "alert" }, detail.error), pr && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("p", { className: "twgit-pr-revision" }, /* @__PURE__ */ React.createElement("strong", null, "#", pr.number, " · ", labels[pr.state]), pr.author && /* @__PURE__ */ React.createElement("span", null, pr.author), /* @__PURE__ */ React.createElement("code", { title: pr.head.sha }, pr.head.ref, " → ", pr.base.ref), /* @__PURE__ */ React.createElement("
|
|
4026
|
+
}, labels.next)))), /* @__PURE__ */ React.createElement("main", { className: "twgit-diff" }, !selection && /* @__PURE__ */ React.createElement("p", null, labels.select), selection && !detail && /* @__PURE__ */ React.createElement("p", { role: "status" }, labels.loading), (detail === null || detail === void 0 ? void 0 : detail.error) && /* @__PURE__ */ React.createElement("p", { role: "alert" }, detail.error), pr && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("p", { className: "twgit-pr-revision" }, /* @__PURE__ */ React.createElement("strong", null, "#", pr.number, pr.state && /* @__PURE__ */ React.createElement(React.Fragment, null, " · ", labels[pr.state])), pr.author && /* @__PURE__ */ React.createElement("span", null, pr.author), /* @__PURE__ */ React.createElement("code", { title: pr.head.sha }, pr.head.ref, " → ", (_pr$base$ref = pr.base.ref) !== null && _pr$base$ref !== void 0 ? _pr$base$ref : pr.base.sha.slice(0, 12)), ((_pr$git = pr.git) === null || _pr$git === void 0 ? void 0 : _pr$git.branches) && /* @__PURE__ */ React.createElement("label", null, labels.base, " ", /* @__PURE__ */ React.createElement("select", {
|
|
4027
|
+
"data-git-pr-base": "",
|
|
4028
|
+
value: (_pr$base$ref2 = pr.base.ref) !== null && _pr$base$ref2 !== void 0 ? _pr$base$ref2 : "",
|
|
4029
|
+
onChange: (event) => setSelection({
|
|
4030
|
+
number: pr.number,
|
|
4031
|
+
base: event.currentTarget.value
|
|
4032
|
+
})
|
|
4033
|
+
}, pr.git.branches.map((branch) => /* @__PURE__ */ React.createElement("option", {
|
|
4034
|
+
key: branch,
|
|
4035
|
+
value: branch
|
|
4036
|
+
}, branch)))), /* @__PURE__ */ React.createElement("a", {
|
|
3924
4037
|
href: pr.url,
|
|
3925
4038
|
target: "_blank",
|
|
3926
4039
|
rel: "noreferrer"
|
|
@@ -3943,7 +4056,16 @@ function PullRequests({ name, labels, locale, renderBlock, locateFor, openTabs }
|
|
|
3943
4056
|
locateBlock: locateFor === null || locateFor === void 0 ? void 0 : locateFor(file.path, pr.head.sha)
|
|
3944
4057
|
}] : [];
|
|
3945
4058
|
}), `${name}#${pr.number}`)
|
|
3946
|
-
}, labels.openTabs)
|
|
4059
|
+
}, labels.openTabs), pr.git && openLocally && /* @__PURE__ */ React.createElement("button", {
|
|
4060
|
+
type: "button",
|
|
4061
|
+
"data-git-open-pr-locally": "",
|
|
4062
|
+
disabled: openLocally.busy,
|
|
4063
|
+
title: labels.openLocallyHint.replace("{branch}", pullRequestBranch(pr.number)),
|
|
4064
|
+
onClick: () => void openLocally.open(pr.number, pr.head.sha)
|
|
4065
|
+
}, labels.openLocally.replace("{branch}", pullRequestBranch(pr.number)))), pr.git && /* @__PURE__ */ React.createElement("p", {
|
|
4066
|
+
className: "twgit-context",
|
|
4067
|
+
role: "status"
|
|
4068
|
+
}, labels.viaConnection, pr.git.branches && /* @__PURE__ */ React.createElement(React.Fragment, null, " ", labels.noMetadata)), /* @__PURE__ */ React.createElement(ProjectSourceReview, {
|
|
3947
4069
|
title: pr.title,
|
|
3948
4070
|
description: pr.description,
|
|
3949
4071
|
files: locateFor ? pr.files.map((file) => "patch" in file ? _objectSpread2$1(_objectSpread2$1({}, file), {}, { locateBlock: locateFor(file.path, pr.head.sha) }) : file) : pr.files,
|
|
@@ -3952,7 +4074,7 @@ function PullRequests({ name, labels, locale, renderBlock, locateFor, openTabs }
|
|
|
3952
4074
|
rememberAs: `${name}#${pr.number}`
|
|
3953
4075
|
}))));
|
|
3954
4076
|
}
|
|
3955
|
-
function PullRequestReviewPanel({ repository, locale, renderBlock, locateFor, openTabs }) {
|
|
4077
|
+
function PullRequestReviewPanel({ repository, locale, renderBlock, locateFor, openTabs, connection, openLocally }) {
|
|
3956
4078
|
const labels = locale.startsWith("ja") ? ja : en;
|
|
3957
4079
|
const [origin, setOrigin] = useState();
|
|
3958
4080
|
useEffect(() => {
|
|
@@ -3988,7 +4110,10 @@ function PullRequestReviewPanel({ repository, locale, renderBlock, locateFor, op
|
|
|
3988
4110
|
locale,
|
|
3989
4111
|
renderBlock,
|
|
3990
4112
|
locateFor,
|
|
3991
|
-
openTabs
|
|
4113
|
+
openTabs,
|
|
4114
|
+
repository,
|
|
4115
|
+
connection,
|
|
4116
|
+
openLocally
|
|
3992
4117
|
});
|
|
3993
4118
|
}
|
|
3994
4119
|
// src/editor-block-locator.ts
|
|
@@ -4394,6 +4519,14 @@ function GitPanel({ vm, document, host, controller }) {
|
|
|
4394
4519
|
};
|
|
4395
4520
|
});
|
|
4396
4521
|
};
|
|
4522
|
+
const pullRequestConnection = useMemo(() => {
|
|
4523
|
+
const settings = host.connectionSettings;
|
|
4524
|
+
const getSession = settings === null || settings === void 0 ? void 0 : settings.getSession;
|
|
4525
|
+
return getSession ? {
|
|
4526
|
+
getSession,
|
|
4527
|
+
connected: () => settings.getView().state.status === "connected"
|
|
4528
|
+
} : void 0;
|
|
4529
|
+
}, [host]);
|
|
4397
4530
|
const [message, setMessage] = useState("");
|
|
4398
4531
|
const localOperation = (operation, notice) => {
|
|
4399
4532
|
const repository = current.current.repository;
|
|
@@ -4433,6 +4566,31 @@ function GitPanel({ vm, document, host, controller }) {
|
|
|
4433
4566
|
if (operation.kind === "createBranch" && !operation.fromRemote && !at) setNewBranch("");
|
|
4434
4567
|
return result;
|
|
4435
4568
|
};
|
|
4569
|
+
/**
|
|
4570
|
+
* Opens a pull request version fetched over the connection: creates `pr/<number>` at its head (or reuses that
|
|
4571
|
+
* branch when it already points there), switches to it with the same refusals as any switch, and opens the project
|
|
4572
|
+
* folder again from it. The branch the person was on stays, so switching back is an ordinary switch.
|
|
4573
|
+
*/
|
|
4574
|
+
const openPullRequest = async (number, head) => {
|
|
4575
|
+
var _current$current$snap, _current$current$snap2;
|
|
4576
|
+
const repository = current.current.repository;
|
|
4577
|
+
if (!repository) return { done: false };
|
|
4578
|
+
const original = (_current$current$snap = (_current$current$snap2 = current.current.snapshot) === null || _current$current$snap2 === void 0 ? void 0 : _current$current$snap2.branch) !== null && _current$current$snap !== void 0 ? _current$current$snap : null;
|
|
4579
|
+
const name = pullRequestBranch(number);
|
|
4580
|
+
const result = await changeBranch({
|
|
4581
|
+
kind: "createBranch",
|
|
4582
|
+
name,
|
|
4583
|
+
at: head,
|
|
4584
|
+
checkout: true,
|
|
4585
|
+
reuse: true
|
|
4586
|
+
});
|
|
4587
|
+
if (!result.done) return result;
|
|
4588
|
+
const project = current.current.project;
|
|
4589
|
+
if (project !== null && await repository.hasFolder(name, project)) await openProject(project);
|
|
4590
|
+
const notice = (original && original !== name ? labels.openedPullRequest : labels.openedPullRequestDetached).replace("{number}", String(number)).replace("{branch}", name).replace("{previous}", original !== null && original !== void 0 ? original : "");
|
|
4591
|
+
if (alive.current) setState((previous) => previous.error ? previous : _objectSpread2$1(_objectSpread2$1({}, previous), {}, { notice }));
|
|
4592
|
+
return result;
|
|
4593
|
+
};
|
|
4436
4594
|
const [history, setHistory] = useState({
|
|
4437
4595
|
commits: [],
|
|
4438
4596
|
cursor: null,
|
|
@@ -4595,7 +4753,12 @@ function GitPanel({ vm, document, host, controller }) {
|
|
|
4595
4753
|
locale,
|
|
4596
4754
|
renderBlock: host.renderReviewBlock,
|
|
4597
4755
|
locateFor: reviewLocator,
|
|
4598
|
-
openTabs
|
|
4756
|
+
openTabs,
|
|
4757
|
+
connection: pullRequestConnection,
|
|
4758
|
+
openLocally: branching ? {
|
|
4759
|
+
open: openPullRequest,
|
|
4760
|
+
busy: state.busy
|
|
4761
|
+
} : void 0
|
|
4599
4762
|
}), !review && state.repository && /* @__PURE__ */ React.createElement("div", { className: "twgit-content" }, /* @__PURE__ */ React.createElement("aside", null, state.browser && /* @__PURE__ */ React.createElement("details", null, /* @__PURE__ */ React.createElement("summary", null, labels.browse), /* @__PURE__ */ React.createElement("p", null, /* @__PURE__ */ React.createElement("code", null, state.browser.path || "/")), /* @__PURE__ */ React.createElement("button", {
|
|
4600
4763
|
disabled: state.busy || !state.browser.path,
|
|
4601
4764
|
onClick: () => void browse(state.browser.path.split("/").slice(0, -1).join("/"))
|
|
@@ -4814,4 +4977,4 @@ function renderGitMenu(createElement, { vm, locale = "en", MenuItem, MenuSection
|
|
|
4814
4977
|
}
|
|
4815
4978
|
}, labelsFor(locale).menu));
|
|
4816
4979
|
}
|
|
4817
|
-
export { GitPanelError, HistoryGraph, createEditorBlockLocator, createReadOnlyFs, createScratchBlocksDiffLocator, createScratchBlocksDiffRenderer, laneColors, layoutHistory, mountGitPanel, openProjectComparison, openProjectSourceTabs, openRepository, renderGitMenu };
|
|
4980
|
+
export { GitPanelError, HistoryGraph, createEditorBlockLocator, createReadOnlyFs, createScratchBlocksDiffLocator, createScratchBlocksDiffRenderer, laneColors, layoutHistory, mountGitPanel, openProjectComparison, openProjectSourceTabs, openRepository, pullRequestBranch, pullRequestRef, renderGitMenu };
|
|
@@ -16,7 +16,8 @@ export type LocalOperation = {
|
|
|
16
16
|
}
|
|
17
17
|
/**
|
|
18
18
|
* Creates `name` at HEAD, at the commit `at`, or at `origin/<name>` with `fromRemote`, and switches to it with
|
|
19
|
-
* `checkout`.
|
|
19
|
+
* `checkout`. With `reuse` (only with `at`), a branch `name` that already points at `at` is switched to instead of
|
|
20
|
+
* failing, and one that points elsewhere fails with `pullRequestBranch` and is never moved.
|
|
20
21
|
*/
|
|
21
22
|
| {
|
|
22
23
|
kind: 'createBranch';
|
|
@@ -24,10 +25,16 @@ export type LocalOperation = {
|
|
|
24
25
|
fromRemote?: boolean;
|
|
25
26
|
at?: string;
|
|
26
27
|
checkout: boolean;
|
|
28
|
+
reuse?: boolean;
|
|
27
29
|
} | {
|
|
28
30
|
kind: 'switchBranch';
|
|
29
31
|
name: string;
|
|
30
32
|
};
|
|
33
|
+
/**
|
|
34
|
+
* The local branch a pull request is opened on: `pr/<number>`, a name `git check-ref-format --branch` accepts. It is
|
|
35
|
+
* created at the fetched head (`pullRequestRef(number)`) and is an ordinary branch afterwards.
|
|
36
|
+
*/
|
|
37
|
+
export declare const pullRequestBranch: (number: number) => string;
|
|
31
38
|
/**
|
|
32
39
|
* Stages, unstages or commits in the granted repository. Like pull, Git's writes are collected first and applied
|
|
33
40
|
* after the files they replace are checked again; a failure part way puts back what was applied. Only `.git/index`,
|
package/dist/messages.d.ts
CHANGED
|
@@ -44,6 +44,10 @@ export declare const messages: {
|
|
|
44
44
|
commitMessage: string;
|
|
45
45
|
switchUnsafe: string;
|
|
46
46
|
branchExists: string;
|
|
47
|
+
branchConflict: string;
|
|
48
|
+
pullRequestBranch: string;
|
|
49
|
+
openedPullRequest: string;
|
|
50
|
+
openedPullRequestDetached: string;
|
|
47
51
|
locked: string;
|
|
48
52
|
branchName: string;
|
|
49
53
|
pullUnsafe: string;
|
|
@@ -152,6 +156,10 @@ export declare const messages: {
|
|
|
152
156
|
commitMessage: string;
|
|
153
157
|
switchUnsafe: string;
|
|
154
158
|
branchExists: string;
|
|
159
|
+
branchConflict: string;
|
|
160
|
+
pullRequestBranch: string;
|
|
161
|
+
openedPullRequest: string;
|
|
162
|
+
openedPullRequestDetached: string;
|
|
155
163
|
locked: string;
|
|
156
164
|
branchName: string;
|
|
157
165
|
pullUnsafe: string;
|