Initial upload to Gitea
This commit is contained in:
1 parent
78193254ad
commit
8478998cae
1485 files changed
+461025
-42348
No files matched your search
@@ -0,0 +1,22 @@
|
||||
package main
|
||||
|
||||
import "path/filepath"
|
||||
|
||||
func removeUploadTemp(scopeHandle *safeRoot, tmpRel string) {
|
||||
if parentFd, err := safeOpenDirAt(scopeHandle, filepath.Dir(tmpRel)); err == nil {
|
||||
_ = safeRemoveAt(parentFd, filepath.Base(tmpRel))
|
||||
_ = parentFd.Close()
|
||||
}
|
||||
}
|
||||
|
||||
// adpanel:upload-no-clobber - PUT must not replace a file created during transfer.
|
||||
func commitStagedUpload(root *safeRoot, tmpRel, name string, createOnly bool) error {
|
||||
if createOnly {
|
||||
return renameNoReplaceUnderRoot(root, tmpRel, name, true)
|
||||
}
|
||||
return safeRenameUnderRoot(root, tmpRel, name)
|
||||
}
|
||||
|
||||
func uploadDestinationExists() map[string]any {
|
||||
return map[string]any{"ok": false, "error": "destination_exists"}
|
||||
}
|
||||
Reference in new issue
Block a user