mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-05 16:23:36 +00:00
Refactor git credentials to be an array instead of an object
This commit is contained in:
12 files changed
+598
-220
No files matched your search
@@ -1,12 +1,14 @@
|
||||
import { createContext } from 'react';
|
||||
|
||||
export interface GitCredential {
|
||||
protocol: string;
|
||||
host: string; // Includes port if non-standard (e.g., "github.com:8080")
|
||||
username: string;
|
||||
password: string;
|
||||
}
|
||||
|
||||
export interface GitSettings {
|
||||
credentials: Record<string, GitCredential>; // keyed by origin
|
||||
credentials: GitCredential[];
|
||||
name?: string;
|
||||
email?: string;
|
||||
coAuthorEnabled?: boolean;
|
||||
@@ -15,9 +17,9 @@ export interface GitSettings {
|
||||
export interface GitSettingsContextType {
|
||||
settings: GitSettings;
|
||||
updateSettings: (settings: Partial<GitSettings>) => void;
|
||||
addCredential: (origin: string, credential: GitCredential) => void;
|
||||
removeCredential: (origin: string) => void;
|
||||
updateCredential: (origin: string, credential: Partial<GitCredential>) => void;
|
||||
addCredential: (credential: GitCredential) => void;
|
||||
removeCredential: (index: number) => void;
|
||||
updateCredential: (index: number, credential: Partial<GitCredential>) => void;
|
||||
isConfigured: boolean;
|
||||
isInitialized: boolean;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user