]> git.ipfire.org Git - thirdparty/git.git/commitdiff
git-p4: handle update of moved/copied files when updating a shelve
authorLuke Diamand <luke@diamand.org>
Fri, 18 Jan 2019 09:36:56 +0000 (09:36 +0000)
committerJunio C Hamano <gitster@pobox.com>
Fri, 18 Jan 2019 17:43:40 +0000 (09:43 -0800)
Perforce requires a complete list of files being operated on. If
git is updating an existing shelved changelist, then any files
which are moved or copied were not being added to this list.

Signed-off-by: Luke Diamand <luke@diamand.org>
Acked-by: Andrey Mazo <amazo@checkvideo.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-p4.py
t/t9807-git-p4-submit.sh

index 1998c3e141bec5142032f08623b916d7741e64ac..b1c262e13df4ce79c2bff2140b2c0ded7c0726da 100755 (executable)
--- a/git-p4.py
+++ b/git-p4.py
@@ -1859,6 +1859,7 @@ class P4Submit(Command, P4UserMap):
                     filesToAdd.remove(path)
             elif modifier == "C":
                 src, dest = diff['src'], diff['dst']
+                all_files.append(dest)
                 p4_integrate(src, dest)
                 pureRenameCopy.add(dest)
                 if diff['src_sha1'] != diff['dst_sha1']:
@@ -1875,6 +1876,7 @@ class P4Submit(Command, P4UserMap):
                 editedFiles.add(dest)
             elif modifier == "R":
                 src, dest = diff['src'], diff['dst']
+                all_files.append(dest)
                 if self.p4HasMoveCommand:
                     p4_edit(src)        # src must be open before move
                     p4_move(src, dest)  # opens for (move/delete, move/add)
index f94854d447d600b3153a3c2f6b5e9a7b872d42ae..850d97911966fe78f22035dab78ac0556a82fd99 100755 (executable)
@@ -546,7 +546,7 @@ test_expect_success 'submit --update-shelve' '
        )
 '
 
-test_expect_failure 'update a shelve involving moved and copied files' '
+test_expect_success 'update a shelve involving moved and copied files' '
        test_when_finished cleanup_git &&
        (
                cd "$cli" &&