File: delete_tag.diff

package info (click to toggle)
ticgit 1.0.2.18-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 488 kB
  • sloc: ruby: 2,848; sh: 124; makefile: 16
file content (31 lines) | stat: -rw-r--r-- 1,241 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Subject: Support “ti tag -d $TAG” to remove tags
From: Michael Schutte <michi@debian.org>

The “tag” command gets confused by the extra “-d” argument and therefore
fails to actually delete tags.  The problem is caused by using the
original list of command line arguments before parsing (ARGV) instead of
the processed one (args).

Index: devel/lib/ticgit-ng/command/tag.rb
===================================================================
--- devel.orig/lib/ticgit-ng/command/tag.rb	2013-06-27 17:59:16.000000000 +0200
+++ devel/lib/ticgit-ng/command/tag.rb	2013-06-27 21:10:31.000000000 +0200
@@ -9,14 +9,10 @@
       end
 
       def execute
-        if options.remove
-          puts 'remove'
-        end
-
-        if ARGV.size > 2 # `ti tag 1234abc tagname1`
-          tic.ticket_tag(ARGV[2], ARGV[1].chomp, options)
-        elsif ARGV.size == 2 # `ti tag tagname1`
-          tic.ticket_tag(ARGV[1], nil, options)
+        if args.size > 1 # `ti tag 1234abc tagname1`
+          tic.ticket_tag(args[1], args[0].chomp, options)
+        elsif args.size == 1 # `ti tag tagname1`
+          tic.ticket_tag(args[0], nil, options)
         else
           puts 'You need to at least specify one tag to add'
           puts