Method: Rugged::Repository#ident
- Defined in:
- ext/rugged/rugged_repo.c
permalink #ident ⇒ Object
Return a Hash containing the identity that is used to write reflogs.
ident
is a Hash containing name
and/or email
entries, or ‘nil`.
746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 |
# File 'ext/rugged/rugged_repo.c', line 746
static VALUE rb_git_repo_get_ident(VALUE self)
{
VALUE rb_ident = rb_hash_new();
git_repository *repo;
const char *name = NULL, *email = NULL;
Data_Get_Struct(self, git_repository, repo);
rugged_exception_check(
git_repository_ident(&name, &email, repo)
);
if (name) {
rb_hash_aset(rb_ident, CSTR2SYM("name"), rb_str_new_utf8(name));
}
if (email) {
rb_hash_aset(rb_ident, CSTR2SYM("email"), rb_str_new_utf8(email));
}
return rb_ident;
}
|