We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
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
Using g.show(":my_file.txt") to see the file as it is returns a string missing the last newline.
g.show(":my_file.txt")
git: git version 2.28.0 ruby-git: 1.7.0 ruby: ruby 2.6.6p146 (2020-03-31 revision 67876) [x86_64-linux]
require "git" puts Git::VERSION Dir.mktmpdir("git_auto_fixup_test") do |root| g = Git.init(root) g.commit("Initial commit", allow_empty: true) File.write("#{root}/my_file.txt", "hello\nworld\n") g.add("my_file.txt") puts "From gem: #{g.show(":my_file.txt").inspect}" puts "From git: #{`git -C #{root} show :my_file.txt`.inspect}" end
Note that only 1 newline is removed. If I put more than one at the end, ruby-git will return one less.
1.7.0 From gem: "hello\nworld" From git: "hello\nworld\n"
1.7.0 From gem: "hello\nworld\n" From git: "hello\nworld\n"
The text was updated successfully, but these errors were encountered:
This is fixed in git-1.8.1.
1.8.1 From gem: "hello\nworld\n" From git: "hello\nworld\n"
Sorry, something went wrong.
test: git show should not chomp results (#513)
e2fd4af
Refs #503 Signed-off-by: James Couball <jcouball@yahoo.com>
No branches or pull requests
Uh oh!
There was an error while loading. Please reload this page.
Subject of the issue
Using
g.show(":my_file.txt")
to see the file as it is returns a string missing the last newline.Your environment
git: git version 2.28.0
ruby-git: 1.7.0
ruby: ruby 2.6.6p146 (2020-03-31 revision 67876) [x86_64-linux]
Steps to reproduce
Note that only 1 newline is removed. If I put more than one at the end, ruby-git will return one less.
Actual behaviour
Expected behaviour
The text was updated successfully, but these errors were encountered: