Skip to content
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

smuge fails on remote repo Fixnum into String (TypeError) #8

Open
kyv opened this issue Mar 2, 2012 · 4 comments
Open

smuge fails on remote repo Fixnum into String (TypeError) #8

kyv opened this issue Mar 2, 2012 · 4 comments

Comments

@kyv
Copy link

kyv commented Mar 2, 2012

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:inrun!'
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

@kyv
Copy link
Author

kyv commented Mar 2, 2012

sorry the is mostly likely a ruby 1.8 error, see:

https://gist.github.com/1744222

@fitorec
Copy link

fitorec commented Mar 5, 2012

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

@kyv
Copy link
Author

kyv commented Mar 8, 2012

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
    

@benjyw
Copy link

benjyw commented Jun 22, 2012

Fixed in 0.1.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants