Skip to content

Commit 8f2537f

Browse files
committed
commit: Change formatting of "issue from branch name"
1 parent 5b50d65 commit 8f2537f

4 files changed

Lines changed: 11 additions & 8 deletions

File tree

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
geordi (12.5.0)
4+
geordi (12.5.1)
55
highline
66
thor (~> 1)
77

features/commit.feature

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ Feature: Creating a git commit from a Linear issue
2828
# No optional message
2929
And I type ""
3030

31-
Then the output should contain "Auto-detected issue [team-123] Test Issue from branch name."
31+
Then the output should contain "Auto-detected issue from branch name:"
32+
And the output should contain "[team-123] Test Issue"
3233
And the output should contain "Use it? [y]"
3334
And the output should contain "Util.run! git, commit, --allow-empty, -m, [team-123] Test Issue"
3435

lib/geordi/linear_client.rb

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,15 @@ def issue_from_branch
7676
fetch_linear_issues.find { |issue| issue['branchName'] == current_branch }
7777
end
7878

79-
return unless issue
79+
if issue
80+
id = issue['identifier']
81+
title = issue['title']
8082

81-
id = issue['identifier']
82-
title = issue['title']
83+
Interaction.note 'Auto-detected issue from branch name:'
84+
puts HighLine::BOLD + "[#{id}] #{title}" + HighLine::RESET
8385

84-
Interaction.note "Auto-detected issue #{HighLine::BOLD}[#{id}] #{title}#{HighLine::RESET} from branch name."
85-
Interaction.prompt("Use it?", "y", /y|yes/i) ? issue : nil
86+
issue if Interaction.prompt('Use it?', 'y', /y|yes/i)
87+
end
8688
end
8789

8890
def extract_issue_ids(commit_messages)

lib/geordi/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module Geordi
2-
VERSION = '12.5.0'.freeze
2+
VERSION = '12.5.1'.freeze
33
end

0 commit comments

Comments
 (0)