mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-10-07 02:58:15 +00:00
working mvp
This commit is contained in:
parent
6b9b2aa4de
commit
973be7640e
2 changed files with 5 additions and 5 deletions
|
|
@ -92,7 +92,7 @@ export class GitFetcher {
|
|||
// Force pull with overwrite
|
||||
await git.fetch("origin", "main")
|
||||
await git.raw(["reset", "--hard", "origin/main"])
|
||||
await git.clean(["--force", "-d"])
|
||||
await git.raw(["clean", "-f", "-d"])
|
||||
} catch (error) {
|
||||
// If pull fails with specific errors that indicate repo corruption,
|
||||
// we should remove and re-clone
|
||||
|
|
@ -133,7 +133,7 @@ export class GitFetcher {
|
|||
await git.clone(repoUrl, repoDir)
|
||||
// Reset to ensure clean state
|
||||
const repoGit = simpleGit(repoDir)
|
||||
await repoGit.clean(["--force", "-d"])
|
||||
await repoGit.raw(["clean", "-f", "-d"])
|
||||
await repoGit.raw(["reset", "--hard", "HEAD"])
|
||||
} catch (error) {
|
||||
// If clone fails, ensure we clean up any partially created directory
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ describe("GitFetcher", () => {
|
|||
|
||||
const mockGit = mockSimpleGit()
|
||||
expect(mockGit.clone).toHaveBeenCalledWith(testRepoUrl, testRepoDir)
|
||||
expect(mockGit.clean).toHaveBeenCalledWith(["--force", "-d"])
|
||||
expect(mockGit.raw).toHaveBeenCalledWith(["clean", "-f", "-d"])
|
||||
expect(mockGit.raw).toHaveBeenCalledWith(["reset", "--hard", "HEAD"])
|
||||
})
|
||||
|
||||
|
|
@ -139,7 +139,7 @@ describe("GitFetcher", () => {
|
|||
const mockGit = mockSimpleGit()
|
||||
expect(mockGit.fetch).toHaveBeenCalledWith("origin", "main")
|
||||
expect(mockGit.raw).toHaveBeenCalledWith(["reset", "--hard", "origin/main"])
|
||||
expect(mockGit.clean).toHaveBeenCalledWith(["--force", "-d"])
|
||||
expect(mockGit.raw).toHaveBeenCalledWith(["clean", "-f", "-d"])
|
||||
expect(mockGit.clone).not.toHaveBeenCalled()
|
||||
})
|
||||
|
||||
|
|
@ -197,7 +197,7 @@ describe("GitFetcher", () => {
|
|||
// Second rm call is after pull failure
|
||||
expect(fs.rm).toHaveBeenCalledWith(testRepoDir, { recursive: true, force: true })
|
||||
expect(mockGit.clone).toHaveBeenCalledWith(testRepoUrl, testRepoDir)
|
||||
expect(mockGit.clean).toHaveBeenCalledWith(["--force", "-d"])
|
||||
expect(mockGit.raw).toHaveBeenCalledWith(["clean", "-f", "-d"])
|
||||
expect(mockGit.raw).toHaveBeenCalledWith(["reset", "--hard", "HEAD"])
|
||||
})
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue