]> source.dussan.org Git - gitea.git/commit
fixed duplicate attachments on dump on windows (#28019) (#28031)
authorGiteabot <teabot@gitea.io>
Tue, 14 Nov 2023 01:56:21 +0000 (09:56 +0800)
committerGitHub <noreply@github.com>
Tue, 14 Nov 2023 01:56:21 +0000 (09:56 +0800)
commit00cd5ba6f4eb444085649aae6167bed32463e76b
treeb483478febf4cffb79eca35baa627900b477e2d0
parenteef41489357a6b57e81f7c9a0a5580553f0f66ef
fixed duplicate attachments on dump on windows (#28019) (#28031)

Backport #28019 by @anudeepreddy

Hi,

This PR fixes #27988. The use of `path.join`(which uses `/` as the file
separator) to construct paths and comparing them with paths constructed
using `filepath.join`(which uses platform specific file separator) is
the root cause of this issue.

The desired behavior is to ignore attachments when dumping data
directory. Due to the what's mentioned above, the function
`addRecursiveExclude` is not actually ignoring the attachments directory
and is being written to the archive. The attachment directory is again
added to the archive (with different file separator as mentioned in the
issue) causing a duplicate entry on windows.

The solution is to use `filepath.join` in `addResursiveExclude` to
construct `currentAbsPath`.

Co-authored-by: Anudeep Reddy <anudeepc85@gmail.com>
cmd/dump.go