Skip to content

Commit

Permalink
Untitled commit
Browse files Browse the repository at this point in the history
  • Loading branch information
kishore03109 committed Dec 6, 2023
1 parent 2ab9ab2 commit a0ae4c9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 24 deletions.
2 changes: 1 addition & 1 deletion src/services/db/GitHubService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -767,7 +767,7 @@ export default class GitHubService {

async updateRepoState(
sessionData: UserWithSiteSessionData,
{ commitSha }: { commitSha: any }
{ commitSha }: { commitSha: string }
) {
const { accessToken } = sessionData
const { siteName } = sessionData
Expand Down
26 changes: 3 additions & 23 deletions src/services/db/RepoService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import { getMediaFileInfo } from "@root/utils/media-utils"

import GitFileCommitService from "./GitFileCommitService"
import GitFileSystemService from "./GitFileSystemService"
import GitHubCommitService from "./GithubCommitService"
import GitHubService from "./GitHubService"
import * as ReviewApi from "./review"

Expand Down Expand Up @@ -448,29 +447,10 @@ export default class RepoService extends GitHubService {
return
}

// GitHub flow
const gitTree = await this.getTree(sessionData, githubSessionData, {
isRecursive: true,
})

// Retrieve removed items and set their sha to null
const newGitTree = gitTree
.filter(
(item) =>
item.path.startsWith(`${directoryName}/`) && item.type !== "tree"
)
.map((item) => ({
...item,
sha: null,
}))

const newCommitSha = await this.updateTree(sessionData, githubSessionData, {
gitTree: newGitTree,
super.deleteDirectory(sessionData, {
directoryName,
message,
})

await this.updateRepoState(sessionData, {
commitSha: newCommitSha,
githubSessionData,
})
}

Expand Down

0 comments on commit a0ae4c9

Please sign in to comment.