Skip to content

Commit 1f44c94

Browse files
committed
saving colons in stash messages from crashes
1 parent 2e23d47 commit 1f44c94

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

lib/git/lib.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1134,7 +1134,7 @@ def stashes_all
11341134
if File.exist?(filename)
11351135
File.open(filename) do |f|
11361136
f.each_with_index do |line, i|
1137-
m = line.match(/:(.*)$/)
1137+
m = line.match(/^[^:]+:(.*)$/)
11381138
arr << [i, m[1].strip]
11391139
end
11401140
end

tests/units/test_stashes.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ def test_stashes_all
3737

3838
assert(g.status.added.assoc('test-file1'))
3939

40-
g.branch.stashes.save('testing-stash-all')
40+
# NOTE colon is important here
41+
g.branch.stashes.save('testing: stash-all')
4142

4243
stashes = g.branch.stashes.all
4344

0 commit comments

Comments
 (0)