@bridgebrew/project 0.0.2 → 0.0.5
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/branches.ts +13 -5
- package/browser/branches.tsx +2 -1
- package/package.json +4 -3
package/branches.ts
CHANGED
|
@@ -375,7 +375,9 @@ export function createBranches(host: BranchesHost, settings: Settings = {}) {
|
|
|
375
375
|
/** The remote git works with from `folder` (bridge#522): its branch's upstream's, else the only one, else `origin`;
|
|
376
376
|
* `undefined` when that remote does not exist. */
|
|
377
377
|
const remoteOf = async (folder: string) => {
|
|
378
|
-
|
|
378
|
+
// Its full name: the short form is `heads/<name>` beside a tag of the same name (plugins#198).
|
|
379
|
+
const head = await git(folder, ['symbolic-ref', '--quiet', 'HEAD']).catch(() => '');
|
|
380
|
+
const branch = head.replace(/^refs\/heads\//, '');
|
|
379
381
|
const tracked = branch && (await git(folder, ['config', '--get', `branch.${branch}.remote`]).catch(() => ''));
|
|
380
382
|
const names = (await git(folder, ['remote']).catch(() => '')).split('\n').filter(Boolean);
|
|
381
383
|
const name = tracked && names.includes(tracked) ? tracked : names.length === 1 ? names[0] : 'origin';
|
|
@@ -748,9 +750,14 @@ export function createBranches(host: BranchesHost, settings: Settings = {}) {
|
|
|
748
750
|
// From the remote's default branch, fetched now, else as fetched last (offline: bridge#540); its local one only
|
|
749
751
|
// without a remote.
|
|
750
752
|
if (base.remote)
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
753
|
+
// Its full ref: a tag of the same name would be fetched in its place, the branch left as it was (plugins#198).
|
|
754
|
+
await remoteGit(folder, [
|
|
755
|
+
'fetch',
|
|
756
|
+
'--quiet',
|
|
757
|
+
'--no-auto-maintenance',
|
|
758
|
+
base.remote,
|
|
759
|
+
`refs/heads/${base.name}`,
|
|
760
|
+
]).catch(() => undefined);
|
|
754
761
|
const from = base.remote && (await resolves(folder, base.ref)) ? base.ref : `refs/heads/${base.name}`;
|
|
755
762
|
const kept = await git(folder, ['branch', '--list', name]);
|
|
756
763
|
const head = await git(folder, ['rev-parse', `${kept ? `refs/heads/${name}` : from}^{commit}`]);
|
|
@@ -892,7 +899,8 @@ export function createBranches(host: BranchesHost, settings: Settings = {}) {
|
|
|
892
899
|
if (branch.isDefault && !confirmed)
|
|
893
900
|
throw new Error(`pushing ${branch.name}, the default branch, needs a confirmation`);
|
|
894
901
|
const remote = (await remoteOf(branch.folder)) ?? 'origin';
|
|
895
|
-
|
|
902
|
+
// Its full ref: a tag of the same name makes the short one ambiguous, and git refuses it (plugins#198).
|
|
903
|
+
await remoteGit(branch.folder, ['push', '-u', remote, `refs/heads/${branch.name}`]).catch((error: unknown) => {
|
|
896
904
|
throw new Error(`${branch.name} is not pushed, git refused: ${reason(error)}`);
|
|
897
905
|
});
|
|
898
906
|
};
|
package/browser/branches.tsx
CHANGED
|
@@ -496,7 +496,8 @@ export function Branches({ ctx, node }: { ctx: Context; node: string }) {
|
|
|
496
496
|
<GitActions
|
|
497
497
|
slug={slug}
|
|
498
498
|
node={node}
|
|
499
|
-
|
|
499
|
+
// Without the GitHub plugin, no pull request is offered: the notice above says why (bridge#557).
|
|
500
|
+
branch={view.github === 'missing' ? { ...branch, pullRequests: false } : branch}
|
|
500
501
|
route={projectBranchesRoute}
|
|
501
502
|
disabled={busy || !!branch.job?.running}
|
|
502
503
|
onAnswer={(answer) =>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bridgebrew/project",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "A project is a folder of work with its bridge.yml, and a node with its own sessions: code, documents, anything; Bridge plugins can be made there too.",
|
|
6
6
|
"keywords": [
|
|
@@ -88,7 +88,8 @@
|
|
|
88
88
|
"/branches/pr": 120000,
|
|
89
89
|
"/branches/remove": 120000
|
|
90
90
|
},
|
|
91
|
-
"provenance": "official"
|
|
91
|
+
"provenance": "official",
|
|
92
|
+
"placement": "workspace"
|
|
92
93
|
},
|
|
93
94
|
"dependencies": {
|
|
94
95
|
"zod": "4.6.5"
|
|
@@ -105,6 +106,6 @@
|
|
|
105
106
|
"typecheck": "bridge plugin check ."
|
|
106
107
|
},
|
|
107
108
|
"engines": {
|
|
108
|
-
"bridge": ">=0.0.1-nightly.
|
|
109
|
+
"bridge": ">=0.0.1-nightly.20261119.1"
|
|
109
110
|
}
|
|
110
111
|
}
|