Skip to content

Commit 2cb24d8

Browse files
authored
fix: place Co-Authors in footer section (#23)
we have to add two newlines to make sure the user doesn't have to enter one on his own
1 parent e7b7898 commit 2cb24d8

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

assets/demo.gif

35 KB
Loading

assets/demo.tape

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Set Shell fish
1313
Hide
1414
Type "cd $(mktemp -d -t git-squad.XXXX)"
1515
Enter
16-
Type "mv ~/.config/git-squad/buddies.yaml ~/.config/git-squad/buddies.yaml.bup"
16+
Type "mv ~/.config/git-squad/buddies.toml ~/.config/git-squad/buddies.toml.bup"
1717
Enter
1818
Type "git-squad alone"
1919
Enter
@@ -83,7 +83,7 @@ Sleep 500ms
8383
Type "git commit"
8484
Enter
8585
Escape
86-
Type "O"
86+
Type "i"
8787
Type "work on file with peter and wendy"
8888
Escape
8989
Sleep 500ms
@@ -95,7 +95,8 @@ Enter
9595
Sleep 5s
9696

9797
Hide
98-
Type "mv ~/.config/git-squad/buddies.yaml.bup ~/.config/git-squad/buddies.yaml"
98+
Type "mv ~/.config/git-squad/buddies.toml.bup ~/.config/git-squad/buddies.toml"
9999
Enter
100100
Type "git-squad alone"
101101
Enter
102+
Sleep 3s

src/git.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,7 @@ pub fn update_commit_template(active_buddies: &Buddies) -> Result<()> {
126126

127127
// Add our section with co-authors if needed
128128
if !active_buddies.buddies.is_empty() {
129-
if !new_content.is_empty() {
130-
new_content.push('\n');
131-
}
132-
133-
new_content.push('\n');
129+
new_content.push_str("\n\n");
134130
new_content.push_str(BEGIN_MARKER);
135131
new_content.push('\n');
136132

0 commit comments

Comments
 (0)