8000 Allow renaming/moving binary/LFS files in the UI by bytedream · Pull Request #34350 · go-gitea/gitea · GitHub
[go: up one dir, main page]

Skip to content

Allow renaming/moving binary/LFS files in the UI #34350

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

Merged
merged 41 commits into from
Jun 17, 2025
Merged
Changes from 1 commit
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
c6598c2
Enable path editing of non text files
bytedream May 2, 2025
f530856
Move lfs cannot edit context data
bytedream May 2, 2025
7684e17
Do not read file if it is too large
bytedream May 2, 2025
dcaadb8
Remove duplicated context data
bytedream May 3, 2025
cf44789
Fix new file not being editable
bytedream May 3, 2025
96bbf81
Merge branch 'main' into non-text-edit
bytedream May 4, 2025
5dc082a
Make LFS file paths editable
bytedream May 5, 2025
349d5b1
Do not show editor for locked lfs file by other user
bytedream May 5, 2025
07845a2
Unify locale keys
bytedream May 5, 2025
6f3b69b
Fix empty binary content after move
bytedream May 5, 2025
e960fe3
Fix file content only read on new file
bytedream May 5, 2025
02fe2db
Revert unnecessary locale key rename
bytedream May 5, 2025
2698321
Syntax and comment changes
bytedream May 5, 2025
691073d
Typo fix
bytedream May 5, 2025
2848fdf
Merge branch 'main' into non-text-edit
bytedream May 6, 2025
1efe0e7
Close data blobs
bytedream May 6, 2025
4d17f51
Remove unnecessary entry blob open
bytedream May 6, 2025
3d64a84
Update lfs pointer checks
bytedream May 6, 2025
9811c28
Merge branch 'main' into non-text-edit
bytedream May 8, 2025
3ad1e7e
Enable commit button only if something has changed
bytedream May 8, 2025
fb3e801
Update comments and names
bytedream May 8, 2025
614a4b3
Update
bytedream May 8, 2025
2c9c9e1
Update comment
bytedream May 8, 2025
07836d8
Refactor
bytedream May 8, 2025
0d27705
Make linter happy
bytedream May 8, 2025
3348c04
Show binary and lfs edit button in pull request changes
bytedream May 8, 2025
7133834
Additionally check if path changed to trigger pure rename operation
bytedream May 8, 2025
8739ebe
Update internal function names
bytedream May 8, 2025
2c2a7c5
Add rename test
bytedream May 8, 2025
627bce9
Format
bytedream May 8, 2025
4e8a8e4
Add copyright
bytedream May 8, 2025
b8d5d35
Update
bytedream May 9, 2025
42b7c87
Get file size from fInfo
bytedream May 9, 2025
32e2f4f
Use NotEditableReason to check if file is editable
bytedream May 9, 2025
bec5dce
Merge remote-tracking branch 'origin/main' into non-text-edit
bytedream May 22, 2025
83c593b
Use integration tests instead of unit
bytedream May 28, 2025
35d85dc
Merge branch 'main' into non-text-edit
bytedream May 28, 2025
fe6f0f9
lint
bytedream May 28, 2025
bc147d2
Merge branch 'non-text-edit' of github.com:bytedream/gitea into byted…
lunny Jun 13, 2025
12324f4
Merge branch 'main' into non-text-edit
lunny Jun 13, 2025
7460a87
Merge branch 'main' into non-text-edit
lunny Jun 16, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Move lfs cannot edit context data
  • Loading branch information
bytedream committed May 2, 2025
commit f53085691e57afc618a772efd8439c3eb9844dcc
9 changes: 3 additions & 6 deletions routers/web/repo/view_file.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,6 @@ func prepareToRenderFile(ctx *context.Context, entry *git.TreeEntry) {
ctx.Data["LFSLockHint"] = ctx.Tr("repo.editor.this_file_locked")
}

// Assume file is not editable first.
if fInfo.isLFSFile {
ctx.Data["EditFileTooltip"] = ctx.Tr("repo.editor.cannot_edit_lfs_files")
}

// read all needed attributes which will be used later
// there should be no performance different between reading 2 or 4 here
attrsMap, err := attribute.CheckAttributes(ctx, ctx.Repo.GitRepo, ctx.Repo.CommitID, attribute.CheckAttributeOpts{
Expand Down Expand Up @@ -290,7 +285,9 @@ func prepareToRenderFile(ctx *context.Context, entry *git.TreeEntry) {
}
}

if !fInfo.isLFSFile {
if fInfo.isLFSFile {
ctx.Data["EditFileTooltip"] = ctx.Tr("repo.editor.cannot_edit_lfs_files")
} else {
if ctx.Repo.CanEnableEditor(ctx, ctx.Doer) {
if lfsLock != nil && lfsLock.OwnerID != ctx.Doer.ID {
ctx.Data["CanEditFile"] = false
Expand Down
0