lib/git_topic.rb
def abandon topic=nil, opts={}
      local_branch =
        if topic.nil?
          parts = topic_parts current_branch
          if parts && parts[:namespace] == "wip" && parts[:user] == user
            topic = current_topic
            current_branch
          else
            raise "Cannot abandon #{current_branch}."
          end
        else
          wip_branch  topic
        end

      unless rb = remote_branch( topic, :strip_remote => true )
        raise "No such topic #{topic}."
      end

      git [
        ( "checkout master"           if current_branch == local_branch ),
        ( "branch -D #{local_branch}" if branches.include? local_branch ),
        "push origin :#{rb}",
      ].compact

      report "Topic #{topic} abandoned."
    end
# Delete +topic+ locally and remotely.  Defaults to current topic if
# unspecified.
#
Delete +topic+ locally and remotely.  Defaults to current topic if
unspecified.
Delete + topic + locally and remotely . Defaults to current topic if unspecified .
def abandon topic=nil, opts={}
      local_branch =
        if topic.nil?
          parts = topic_parts current_branch
          if parts && parts[:namespace] == "wip" && parts[:user] == user
            topic = current_topic
            current_branch
          else
            raise "Cannot abandon #{current_branch}."
          end
        else
          wip_branch  topic
        end
      unless rb = remote_branch( topic, :strip_remote => true )
        raise "No such topic #{topic}."
      end
      git [
        ( "checkout master"           if current_branch == local_branch ),
        ( "branch -D #{local_branch}" if branches.include? local_branch ),
        "push origin :#{rb}",
      ].compact
      report "Topic #{topic} abandoned."
    end
def abandon topic = nil , opts = { } local_branch = if topic . nil? parts = topic_parts current_branch if parts && parts [ :namespace ] == "wip" && parts [ :user ] == user topic = current_topic current_branch else raise "Cannot abandon #{current_branch}." end else wip_branch topic end unless rb = remote_branch ( topic , :strip_remote => true ) raise "No such topic #{topic}." end git [ ( "checkout master" if current_branch == local_branch ) , ( "branch -D #{local_branch}" if branches . include? local_branch ) , "push origin :#{rb}" , ] . compact report "Topic #{topic} abandoned." end
Delete +topic+ locally and remotely.
Delete + topic + locally and remotely .
topic
opts