1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-09-07 21:58:41 +02:00

Fix 'mv' command when renaming a file multiple times

This commit is contained in:
2024-05-27 07:52:35 +02:00
parent dfff8371f8
commit e04651fa82
2 changed files with 37 additions and 0 deletions

View File

@@ -19,3 +19,36 @@ Scenario: Run `osc mv <file> <new-name>` in a package checkout
"""
And file "{context.osc.temp}/test:factory/test-pkgA/test-pkgA.changes" does not exist
And file "{context.osc.temp}/test:factory/test-pkgA/new-name.changes" exists
Scenario: Run `osc mv <file> <new-name>` several times
When I execute osc with args "mv test-pkgA.changes test-pkgA.changes-1"
Then the exit code is 0
And I execute osc with args "status"
And stdout is
"""
D test-pkgA.changes
A test-pkgA.changes-1
"""
And file "{context.osc.temp}/test:factory/test-pkgA/test-pkgA.changes" does not exist
And file "{context.osc.temp}/test:factory/test-pkgA/test-pkgA.changes-1" exists
When I execute osc with args "mv test-pkgA.changes-1 test-pkgA.changes-2"
Then the exit code is 0
And I execute osc with args "status"
And stdout is
"""
D test-pkgA.changes
A test-pkgA.changes-2
"""
And file "{context.osc.temp}/test:factory/test-pkgA/test-pkgA.changes" does not exist
And file "{context.osc.temp}/test:factory/test-pkgA/test-pkgA.changes-2" exists
When I execute osc with args "mv test-pkgA.changes-2 test-pkgA.changes-3"
Then the exit code is 0
And I execute osc with args "status"
And stdout is
"""
D test-pkgA.changes
A test-pkgA.changes-3
"""
And file "{context.osc.temp}/test:factory/test-pkgA/test-pkgA.changes" does not exist
And file "{context.osc.temp}/test:factory/test-pkgA/test-pkgA.changes-3" exists