-
Notifications
You must be signed in to change notification settings - Fork 2.5k
feat: add Forgejo as a source control provider #3028
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
f62ae83
c18706a
fd0e36d
e3ab19c
b333336
cf7b643
16a0f01
2f1aef5
46c6b97
e63be7a
2d4ed04
434a11a
2c9905b
7d7eb52
b04eab9
a5648bf
a7852c5
339b3ee
62d7841
f2565ce
8ae9963
a30b444
1dfd06b
f58be49
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -798,11 +798,28 @@ export const makeGitManager = Effect.fn("makeGitManager")(function* () { | |
| branch === null | ||
| ? "origin" | ||
| : ((yield* readConfigValueNullable(cwd, `branch.${branch}.remote`)) ?? "origin"); | ||
| const preferredRemoteUrl = yield* readConfigValueNullable( | ||
| cwd, | ||
| `remote.${preferredRemoteName}.url`, | ||
| ); | ||
| const remoteName = preferredRemoteUrl ? preferredRemoteName : "origin"; | ||
| const remoteUrl = | ||
| (yield* readConfigValueNullable(cwd, `remote.${preferredRemoteName}.url`)) ?? | ||
| (yield* readConfigValueNullable(cwd, "remote.origin.url")); | ||
| preferredRemoteUrl ?? (yield* readConfigValueNullable(cwd, "remote.origin.url")); | ||
| if (!remoteUrl) return null; | ||
|
|
||
| const detected = detectSourceControlProviderFromGitRemoteUrl(remoteUrl); | ||
| if (detected && detected.kind !== "unknown") { | ||
| return detected; | ||
| } | ||
|
|
||
| return remoteUrl ? detectSourceControlProviderFromGitRemoteUrl(remoteUrl) : null; | ||
| // Forgejo has no canonical hostname, so static detection returns "unknown" for its | ||
| // self-hosted instances. Refine THIS branch's remote via `fj auth list` (not origin), | ||
| // but only adopt the result when it resolves to Forgejo so other providers keep their | ||
| // existing status behavior. | ||
| const refined = yield* sourceControlProviders | ||
| .refineRemoteProvider({ cwd, remoteName, remoteUrl }) | ||
| .pipe(Effect.orElseSucceed(() => null)); | ||
| return refined?.kind === "forgejo" ? refined : detected; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Status provider mismatches PR lookupMedium Severity
Additional Locations (1)Reviewed by Cursor Bugbot for commit 1dfd06b. Configure here.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Leaving this as-is intentionally. Git status resolves the hosting provider from the current branch's tracking remote (branch-aware, with Forgejo refinement), while PR lookup ( In the common case — a Forgejo repo whose |
||
| }); | ||
|
|
||
| const resolveRemoteRepositoryContext = Effect.fn("resolveRemoteRepositoryContext")(function* ( | ||
|
|
||


Uh oh!
There was an error while loading. Please reload this page.