修复git未跟踪文件目录显示不全
This commit is contained in:
@@ -583,7 +583,7 @@ export function GitChangesTab() {
|
||||
setError(null)
|
||||
|
||||
try {
|
||||
const statusEntries = await gitStatus(folder.path)
|
||||
const statusEntries = await gitStatus(folder.path, true)
|
||||
const hasTrackedEntries = statusEntries.some(
|
||||
(entry) => !isUntrackedStatus(entry.status)
|
||||
)
|
||||
@@ -739,7 +739,7 @@ export function GitChangesTab() {
|
||||
setDirectoryGitLoading(true)
|
||||
|
||||
try {
|
||||
const statusEntries = await gitStatus(folder.path)
|
||||
const statusEntries = await gitStatus(folder.path, true)
|
||||
const scopedEntries = scopeGitStatusEntriesForDirectory(
|
||||
statusEntries,
|
||||
target.path
|
||||
|
||||
@@ -318,7 +318,7 @@ export function CommitWorkspace({
|
||||
setLoadingStatus(true)
|
||||
setError(null)
|
||||
try {
|
||||
const result = await gitStatus(folderPath)
|
||||
const result = await gitStatus(folderPath, true)
|
||||
setEntries(result)
|
||||
const tracked = result.filter(
|
||||
(entry) => entry.status !== UNTRACKED_STATUS
|
||||
|
||||
@@ -762,8 +762,14 @@ export async function gitSetRemoteUrl(
|
||||
return invoke("git_set_remote_url", { path, name, url })
|
||||
}
|
||||
|
||||
export async function gitStatus(path: string): Promise<GitStatusEntry[]> {
|
||||
return invoke("git_status", { path })
|
||||
export async function gitStatus(
|
||||
path: string,
|
||||
showAllUntracked?: boolean
|
||||
): Promise<GitStatusEntry[]> {
|
||||
return invoke("git_status", {
|
||||
path,
|
||||
showAllUntracked: showAllUntracked ?? null,
|
||||
})
|
||||
}
|
||||
|
||||
export async function gitDiff(path: string, file?: string): Promise<string> {
|
||||
|
||||
Reference in New Issue
Block a user