lib/pivotal-github/story_commit.rb in pivotal-github-0.7.0 vs lib/pivotal-github/story_commit.rb in pivotal-github-0.8.0
- old
+ new
@@ -22,24 +22,20 @@
puts opts.to_s; exit 0
end
end
end
+ # Returns the message for the story id(s) and action (if any).
def message
- if story_ids.empty?
- # Arranges to fall through to regular 'git commit'
- options.message
+ if finish?
+ label = "Finishes #{message_ids}"
+ elsif deliver?
+ label = "Delivers #{message_ids}"
else
- if finish?
- label = "Finishes #{message_ids}"
- elsif deliver?
- label = "Delivers #{message_ids}"
- else
- label = message_ids
- end
- "[#{label}] #{options.message}"
+ label = message_ids
end
+ "[#{label}]"
end
# Returns the story ids formatted for story commits.
# For single-id stories, this is just the number preceded by '#', as in
# '#6283185'. For multiple-id stories, each story id is precede by '#', as in
@@ -52,10 +48,11 @@
# We take care to insert the story number and, if necessary, an indication
# that the commit finishes the story.
def cmd
c = ['git commit']
c << '-a' if all?
- c << %(-m "#{message}") if message?
+ c << %(-m "#{options.message}") if message?
+ c << %(-m "#{message}") unless story_ids.empty?
c << argument_string(unknown_options) unless unknown_options.empty?
c.join(' ')
end
def run!
\ No newline at end of file