Fix the --name option for the pick command
authorCatalin Marinas <catalin.marinas@gmail.com>
Fri, 11 Nov 2005 10:12:46 +0000 (10:12 +0000)
committerCatalin Marinas <catalin.marinas@gmail.com>
Fri, 11 Nov 2005 10:12:46 +0000 (10:12 +0000)
If a patch name from a different branch is given, the --name option is
ignored.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
stgit/commands/pick.py

index c425945..3c52a49 100644 (file)
@@ -59,10 +59,10 @@ def func(parser, options, args):
             raise CmdException, 'No patches applied'
     else:
         patch_branch = commit_str.split('@')
-        if len(patch_branch) == 2:
-            patch = patch_branch[0]
-        elif options.name:
+        if options.name:
             patch = options.name
+        elif len(patch_branch) == 2:
+            patch = patch_branch[0]
         else:
             raise CmdException, 'Unkown patch name'