-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Proper remote‐refs handling #583
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
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
f6d9208
feat(core): Add getRemoteRefs function to retrieve remote repository …
yamadashy 8f9b307
refactor(core/git): Improve parseRemoteValue function formatting and …
yamadashy 7a09a8d
fix(core): Add URL validation to getRemoteRefs function to prevent co…
devin-ai-integration[bot] 2860e53
fix(core): Update URL validation in getRemoteRefs to check for git@ o…
devin-ai-integration[bot] 2f4f842
fix(core): Throw errors for invalid URLs in getRemoteRefs function
devin-ai-integration[bot] 9c4e773
style: Fix linting issues in gitCommand.test.ts
devin-ai-integration[bot] 881e55e
fix(core): Enhance URL validation in getRemoteRefs to pass CodeQL check
devin-ai-integration[bot] 70bbaa1
refactor(core): Create common URL validation function for Git commands
devin-ai-integration[bot] 5421a1f
refactor(types): Add type definition for git-url-parse refs parameter
devin-ai-integration[bot] bd05347
docs(types): Add documentation explaining the purpose of git-url-pars…
devin-ai-integration[bot] f1d8f2f
style: Fix Biome linting issues in git-url-parse.d.ts
devin-ai-integration[bot] 9c79a11
refactor: Remove Japanese documentation and move validateGitUrl to en…
devin-ai-integration[bot] 3dda598
refactor: Improve error message for invalid URL protocol
devin-ai-integration[bot] 58495bc
style: Fix formatting in gitCommand.test.ts
devin-ai-integration[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| /** | ||
| * Type definition extension for git-url-parse library | ||
| * | ||
| * This file exists because the git-url-parse library's built-in type definitions | ||
| * are incomplete. The library supports a second 'refs' parameter for the gitUrlParse | ||
| * function, which is documented in the library's README but not included in its | ||
| * type definitions. | ||
| * | ||
| * Without this type definition extension, we would need to use @ts-ignore when | ||
| * calling gitUrlParse with the refs parameter, which reduces type safety and | ||
| * makes the code harder to maintain. | ||
| * | ||
| * This file uses TypeScript's module augmentation feature to extend the existing | ||
| * type definitions without modifying the original library code. | ||
| */ | ||
|
|
||
| declare module 'git-url-parse' { | ||
| import gitUp = require('git-up'); | ||
|
|
||
| namespace gitUrlParse { | ||
| interface GitUrl extends gitUp.ParsedUrl { | ||
| /** The Git provider (e.g. `"github.com"`). */ | ||
| source: string; | ||
| /** The repository owner. */ | ||
| owner: string; | ||
| /** The repository name. */ | ||
| name: string; | ||
| /** The repository ref (e.g., "master" or "dev"). */ | ||
| ref: string; | ||
| /** A filepath relative to the repository root. */ | ||
| filepath: string; | ||
| /** The type of filepath in the url ("blob" or "tree"). */ | ||
| filepathtype: string; | ||
| /** The owner and name values in the `owner/name` format. */ | ||
| full_name: string; | ||
| /** The organization the owner belongs to. This is CloudForge specific. */ | ||
| organization: string; | ||
| /** Whether to add the `.git` suffix or not. */ | ||
| git_suffix?: boolean | undefined; | ||
| toString(type?: string): string; | ||
| } | ||
|
|
||
| function stringify(url: GitUrl, type?: string): string; | ||
| } | ||
|
|
||
| /** | ||
| * Parses a Git url. | ||
| * @param url The Git url to parse. | ||
| * @param refs An array of strings representing the refs. This is helpful for URLs with branches containing slashes. | ||
| * @returns The GitUrl object containing parsed information. | ||
| */ | ||
| function gitUrlParse(url: string, refs?: string[]): gitUrlParse.GitUrl; | ||
|
|
||
| export = gitUrlParse; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.