mirror of
https://github.com/Dictionarry-Hub/profilarr.git
synced 2026-01-30 06:10:56 +01:00
feat(git): add isFileUncommitted utility and update cancelOutCreate logic
fix(repo): change pull command to standard without rebase fix(changes): ensure UI refresh after discarding and adding changes fix(delay-profile): correct label structure for tags in DelayProfileForm
This commit is contained in:
@@ -115,10 +115,10 @@ export async function fetch(repoPath: string): Promise<void> {
|
||||
}
|
||||
|
||||
/**
|
||||
* Pull with rebase
|
||||
* Pull from remote
|
||||
*/
|
||||
export async function pull(repoPath: string): Promise<void> {
|
||||
await execGit(['pull', '--rebase'], repoPath);
|
||||
await execGit(['pull'], repoPath);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -133,6 +133,23 @@ export async function getBranches(repoPath: string): Promise<string[]> {
|
||||
return branches;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a file is uncommitted (untracked or staged but not yet committed)
|
||||
*/
|
||||
export async function isFileUncommitted(repoPath: string, filepath: string): Promise<boolean> {
|
||||
// Get relative path from repo root
|
||||
const relativePath = filepath.startsWith(repoPath + '/')
|
||||
? filepath.slice(repoPath.length + 1)
|
||||
: filepath;
|
||||
|
||||
const output = await execGitSafe(['status', '--porcelain', relativePath], repoPath);
|
||||
if (!output) return false;
|
||||
|
||||
const status = output.substring(0, 2);
|
||||
// ?? = untracked, A = added (staged), AM = added and modified
|
||||
return status.startsWith('??') || status[0] === 'A';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get commit history
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user