-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gitea dump doubles all attachments on Windows #27988
Labels
Comments
6543
pushed a commit
that referenced
this issue
Nov 14, 2023
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`.
GiteaBot
pushed a commit
to GiteaBot/gitea
that referenced
this issue
Nov 14, 2023
Hi, This PR fixes go-gitea#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`.
lunny
pushed a commit
that referenced
this issue
Nov 14, 2023
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 <[email protected]>
fuxiaohei
pushed a commit
to fuxiaohei/gitea
that referenced
this issue
Jan 17, 2024
Hi, This PR fixes go-gitea#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`.
silverwind
pushed a commit
to silverwind/gitea
that referenced
this issue
Feb 20, 2024
Hi, This PR fixes go-gitea#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`.
project-mirrors-bot-tu bot
pushed a commit
to project-mirrors/forgejo-as-gitea-fork
that referenced
this issue
Jan 23, 2025
…itea#28031) Backport go-gitea#28019 by @anudeepreddy Hi, This PR fixes go-gitea#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 <[email protected]> (cherry picked from commit 00cd5ba)
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Description
i have 1 attachment, for example
data\attachments\2\a\2a08a9d1-9b6f-4c6b-b2de-9bed9505ba22
after
gitea dump
in dump file i found two copies of each attachmentbut one of them writed as
data/attachments/2/a/2a08a9d1-9b6f-4c6b-b2de-9bed9505ba22
second as
data/attachments/2\a\2a08a9d1-9b6f-4c6b-b2de-9bed9505ba22
Gitea Version
1.20.5
Can you reproduce the bug on the Gitea demo site?
No
Log Gist
No response
Screenshots
No response
Git Version
2.42.0.windows.2
Operating System
Windows 11
How are you running Gitea?
from command line gitea-1.20.5-windows-4.0-amd64.exe
Database
SQLite
The text was updated successfully, but these errors were encountered: