diff --git a/react-gosh/src/gosh/1.0.0/adapter.ts b/react-gosh/src/gosh/1.0.0/adapter.ts index 6cc442f37..c7bb27ddb 100644 --- a/react-gosh/src/gosh/1.0.0/adapter.ts +++ b/react-gosh/src/gosh/1.0.0/adapter.ts @@ -1961,7 +1961,7 @@ class GoshRepositoryAdapter implements IGoshRepositoryAdapter { return value0 } - private async _getSnapshot(options: { + async _getSnapshot(options: { fullpath?: string address?: TAddress }): Promise { diff --git a/react-gosh/src/gosh/2.0.0/adapter.ts b/react-gosh/src/gosh/2.0.0/adapter.ts index 3fc7dcd30..21fa19b6a 100644 --- a/react-gosh/src/gosh/2.0.0/adapter.ts +++ b/react-gosh/src/gosh/2.0.0/adapter.ts @@ -3047,7 +3047,7 @@ class GoshRepositoryAdapter implements IGoshRepositoryAdapter { return value0 } - private async _getSnapshot(options: { + async _getSnapshot(options: { fullpath?: string address?: TAddress }): Promise { diff --git a/react-gosh/src/gosh/3.0.0/adapter.ts b/react-gosh/src/gosh/3.0.0/adapter.ts index 7342e4944..cfabe6b2e 100644 --- a/react-gosh/src/gosh/3.0.0/adapter.ts +++ b/react-gosh/src/gosh/3.0.0/adapter.ts @@ -3467,7 +3467,7 @@ class GoshRepositoryAdapter implements IGoshRepositoryAdapter { return value0 } - private async _getSnapshot(options: { + async _getSnapshot(options: { fullpath?: string address?: TAddress }): Promise { diff --git a/react-gosh/src/gosh/4.0.0/adapter.ts b/react-gosh/src/gosh/4.0.0/adapter.ts index a2298db40..00f0b7f9a 100644 --- a/react-gosh/src/gosh/4.0.0/adapter.ts +++ b/react-gosh/src/gosh/4.0.0/adapter.ts @@ -3535,7 +3535,7 @@ class GoshRepositoryAdapter implements IGoshRepositoryAdapter { return value0 } - private async _getSnapshot(options: { + async _getSnapshot(options: { fullpath?: string address?: TAddress }): Promise { diff --git a/react-gosh/src/gosh/5.0.0/adapter.ts b/react-gosh/src/gosh/5.0.0/adapter.ts index 2ecdf2f0d..4dc5e901c 100644 --- a/react-gosh/src/gosh/5.0.0/adapter.ts +++ b/react-gosh/src/gosh/5.0.0/adapter.ts @@ -4024,7 +4024,7 @@ class GoshRepositoryAdapter implements IGoshRepositoryAdapter { return value0 } - private async _getSnapshot(options: { + async _getSnapshot(options: { fullpath?: string address?: TAddress }): Promise { diff --git a/react-gosh/src/gosh/5.1.0/adapter.ts b/react-gosh/src/gosh/5.1.0/adapter.ts index 32ba5f262..14fd76358 100644 --- a/react-gosh/src/gosh/5.1.0/adapter.ts +++ b/react-gosh/src/gosh/5.1.0/adapter.ts @@ -4024,7 +4024,7 @@ class GoshRepositoryAdapter implements IGoshRepositoryAdapter { return value0 } - private async _getSnapshot(options: { + async _getSnapshot(options: { fullpath?: string address?: TAddress }): Promise { diff --git a/react-gosh/src/gosh/6.0.0/adapter.ts b/react-gosh/src/gosh/6.0.0/adapter.ts index e0979a42b..5f0fdcd7f 100644 --- a/react-gosh/src/gosh/6.0.0/adapter.ts +++ b/react-gosh/src/gosh/6.0.0/adapter.ts @@ -4133,7 +4133,7 @@ class GoshRepositoryAdapter implements IGoshRepositoryAdapter { return value0 } - private async _getSnapshot(options: { + async _getSnapshot(options: { fullpath?: string address?: TAddress }): Promise { diff --git a/react-gosh/src/gosh/6.1.0/adapter.ts b/react-gosh/src/gosh/6.1.0/adapter.ts index 0bbb3abca..7d8cfa2c6 100644 --- a/react-gosh/src/gosh/6.1.0/adapter.ts +++ b/react-gosh/src/gosh/6.1.0/adapter.ts @@ -4157,7 +4157,7 @@ class GoshRepositoryAdapter implements IGoshRepositoryAdapter { return value0 } - private async _getSnapshot(options: { + async _getSnapshot(options: { fullpath?: string address?: TAddress }): Promise { diff --git a/react-gosh/src/gosh/interfaces.ts b/react-gosh/src/gosh/interfaces.ts index 0a095a287..9b6bfc91d 100644 --- a/react-gosh/src/gosh/interfaces.ts +++ b/react-gosh/src/gosh/interfaces.ts @@ -361,6 +361,10 @@ interface IGoshRepositoryAdapter { content: string | Buffer ipfs: boolean }> + _getSnapshot(options: { + fullpath?: string + address?: TAddress + }): Promise getCommit(options: { name?: string; address?: TAddress }): Promise _getCommit(options: { name?: string; address?: TAddress }): Promise getCommitBlob( diff --git a/react-gosh/src/hooks/repo.hooks.ts b/react-gosh/src/hooks/repo.hooks.ts index bd770b854..dc0343eec 100644 --- a/react-gosh/src/hooks/repo.hooks.ts +++ b/react-gosh/src/hooks/repo.hooks.ts @@ -1061,12 +1061,11 @@ function _useMergeRequest( async (treepath, index) => { const { src, dst } = treepath const srcFullPath = `${src.treeitem.commit}/${src.path}` - const _srcBlob = await srcRepo.getBlob({ - commit: srcBranch.commit.name, + const _srcSnapshot = await srcRepo._getSnapshot({ fullpath: srcFullPath, }) const srcBlob = await srcRepo.getCommitBlob( - _srcBlob.address, + _srcSnapshot.address, src.path, srcBranch.commit.name, ) @@ -1075,12 +1074,11 @@ function _useMergeRequest( const dstFullPath = `${dst.treeitem?.commit}/${dst.path}` let dstContent: string | Buffer = '' if (dst.path) { - const _dstBlob = await dstRepo.getBlob({ - commit: dstBranch.commit.name, + const _dstSnapshot = await dstRepo._getSnapshot({ fullpath: dstFullPath, }) const dstBlob = await dstRepo.getCommitBlob( - _dstBlob.address, + _dstSnapshot.address, dst.path, dstBranch.commit.name, )