-
Notifications
You must be signed in to change notification settings - Fork 285
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug fix: Git provider on_branch? retains trailing newline #109
Conversation
|
I'm wholly inexperienced with Ruby, so if there's a better way of doing this than strip (which on_branch? was doing originally), feel free to say so. |
|
Does |
|
Oh, on_branch? was pre-existing, let's leave it as is. Looking around, the more common pattern in this file is I see your python roots :) Instead of: |
|
Thanks for your reply, sodabrew; I made the chomp change.
Actually, no Python here---that wasn't my line, but I did make the formatting changes that you requested. |
| @@ -253,7 +253,7 @@ def branches | |||
| end | |||
|
|
|||
| def on_branch? | |||
| at_path { git_with_identity('rev-parse', '--abbrev-ref', 'HEAD') } | |||
| at_path { git_with_identity('rev-parse', '--abbrev-ref', 'HEAD') }.chomp | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: chomp inside the brackets
|
Thanks @mikegerwitz! |
| context "retrieving the current revision" do | ||
| before do | ||
| expects_chdir | ||
| provider.expects(:git).with('rev-parse', '--abbrev-ref', 'HEAD').returns("foo\n") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice test for the newline!
|
Heh, whoops---thanks; corrected. |
|
One final request, could you use 'git rebase -i master' to squash the three commits together? |
This commit also contains git provider `latest' method formatting changes; squashed by request.
Bug fix: Git provider on_branch? retains trailing newline
I submitted a patch yesterday for using --abbrev-ref for on_branch?; unfortunately, there is a trailing newline, which causes problems when the repository already exists: