ext/rugged/rugged_signature.c in rugged-0.26.0b5 vs ext/rugged/rugged_signature.c in rugged-0.26.0

- old
+ new

@@ -33,10 +33,23 @@ rb_hash_aset(rb_sig, CSTR2SYM("time"), rb_time); return rb_sig; } +VALUE rugged_signature_from_buffer(const char *buffer, const char *encoding_name) +{ + git_signature *sig; + VALUE rb_ret; + + rugged_exception_check(git_signature_from_buffer(&sig, buffer)); + + rb_ret = rugged_signature_new(sig, encoding_name); + git_signature_free(sig); + + return rb_ret; +} + git_signature *rugged_signature_get(VALUE rb_sig, git_repository *repo) { int error; VALUE rb_time, rb_unix_t, rb_offset, rb_name, rb_email, rb_time_offset; git_signature *sig; @@ -48,11 +61,11 @@ return sig; } Check_Type(rb_sig, T_HASH); - rb_name = rb_hash_aref(rb_sig, CSTR2SYM("name")); - rb_email = rb_hash_aref(rb_sig, CSTR2SYM("email")); + rb_name = rb_hash_fetch(rb_sig, CSTR2SYM("name")); + rb_email = rb_hash_fetch(rb_sig, CSTR2SYM("email")); rb_time = rb_hash_aref(rb_sig, CSTR2SYM("time")); rb_time_offset = rb_hash_aref(rb_sig, CSTR2SYM("time_offset")); Check_Type(rb_name, T_STRING); Check_Type(rb_email, T_STRING);