Commit c0e2317c authored by Rubén Dávila's avatar Rubén Dávila

Update file lock status when locking file through Git LFS

parent f684346b
module Lfs
class LockFileService < BaseService
prepend EE::Lfs::LockFileService
def execute
if current_lock
error('already created lock', 409, current_lock)
......
module Lfs
class UnlockFileService < BaseService
prepend EE::Lfs::UnlockFileService
def execute
@lock = project.lfs_file_locks.find_by(id: params[:id])
......
module EE
module Lfs
module LockFileService
def execute
result = super
if (result[:status] == :success) && project.feature_available?(:file_locks)
PathLocks::LockService.new(project, current_user).execute(result[:lock].path)
end
result
end
end
end
end
module EE
module Lfs
module UnlockFileService
def execute
result = super
if (result[:status] == :success) && project.feature_available?(:file_locks)
if path_lock = project.path_locks.find_by(path: result[:lock].path)
PathLocks::UnlockService.new(project, current_user).execute(path_lock)
end
end
result
end
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment