Merge pull request #5385 from salvorizza/json-unlock-id-fix
Unlock by ID with JSON Flag returns empty array
This commit is contained in:
commit
4f18bc4678
@ -109,6 +109,11 @@ func unlockCommand(cmd *cobra.Command, args []string) {
|
||||
success = false
|
||||
} else if !locksCmdFlags.JSON {
|
||||
Print(tr.Tr.Get("Unlocked Lock %s", unlockCmdFlags.Id))
|
||||
} else {
|
||||
locks = append(locks, unlockResponse{
|
||||
Id: unlockCmdFlags.Id,
|
||||
Unlocked: true,
|
||||
})
|
||||
}
|
||||
} else {
|
||||
Exit(tr.Tr.Get("Exactly one of --id or a set of paths must be provided"))
|
||||
|
@ -308,6 +308,25 @@ begin_test "unlocking a lock by id"
|
||||
)
|
||||
end_test
|
||||
|
||||
begin_test "unlocking a lock by id (--json)"
|
||||
(
|
||||
set -e
|
||||
|
||||
reponame="unlock_by_id_json"
|
||||
setup_repo "$reponame" "c_json.dat"
|
||||
|
||||
git lfs lock --json "c_json.dat" | tee lock.log
|
||||
|
||||
id=$(assert_lock lock.log c_json.dat)
|
||||
assert_server_lock "$reponame" "$id"
|
||||
|
||||
git lfs unlock --json --id="$id" 2>&1 | tee unlock.log
|
||||
grep "\"unlocked\":true" unlock.log
|
||||
|
||||
refute_server_lock "$reponame" "$id"
|
||||
)
|
||||
end_test
|
||||
|
||||
begin_test "unlocking a lock without sufficient info"
|
||||
(
|
||||
set -e
|
||||
|
Loading…
Reference in New Issue
Block a user