git-media
git-media copied to clipboard
smuge fails on remote repo Fixnum into String (TypeError)
hi,
I have a local repo in which i edit markdown and save binary files. And a remote repo which i push to. Both repos are configured to use git-media (in case someone adds an image directly to the remote repo). Binary files are 'synced' to remote server.
The problem i encounter is that smudge fails on remote repo when i push to it.
remote: /var/lib/gems/1.8/gems/git-media-0.1.1/lib/git-media/filter-smudge.rb:9:in readline': can't convert Fixnum into String (TypeError) remote: from /var/lib/gems/1.8/gems/git-media-0.1.1/lib/git-media/filter-smudge.rb:9:in
run!'
remote: from /var/lib/gems/1.8/gems/git-media-0.1.1/lib/git-media.rb:82:in `run!'
remote: from /usr/local/bin/git-media:8
remote: error: external filter git-media filter-smudge failed 1
remote: error: external filter git-media filter-smudge failed
remote: Saving media : bcb197a0e150b3f86a473dbc1bf336dd7b9a13d7 : 0.00142
remote: Saving media : 24a4df6c0f142f3f773ae63333616151b9bf991e : 0.001701
remote: Saving media : 21c8df31d4523c799aaea8b9b33ea46f5f65599f : 0.00233
remote: Saving media : 5ca114dea611a0488f46df21c96100803b0b1096 : 0.001581
sorry the is mostly likely a ruby 1.8 error, see:
https://gist.github.com/1744222
The difference between the versions between version 1.8.7 and 1.9.3, since 1.8.7 does not support a number as argument, see detail:
http://ruby-doc.org/core-1.8.7/IO.html#method-i-readline http://ruby-doc.org/core-1.9.3/IO.html#method-i-readline
Maybe catch the version and implement a difference in the way it generates sha in FilterSmudge:09
Yes sounds easy unfortunatly i dont know ruby but hopefully i can learn enough soon in order to implement a version check. For now, i can confirm that the following change fixes the problem for me on my setup:
-
sha = STDIN.readline(64).strip # read no more than 64 bytes
-
sha = STDIN.gets.chomp # read no more than 64 bytes
Fixed in 0.1.4