1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
|
# File 'ext/rugged/rugged_repo.c', line 1120
static VALUE rb_git_repo_exists(VALUE self, VALUE hex)
{
git_repository *repo;
git_odb *odb;
git_oid oid;
int error;
Data_Get_Struct(self, git_repository, repo);
Check_Type(hex, T_STRING);
error = git_oid_fromstrn(&oid, RSTRING_PTR(hex), RSTRING_LEN(hex));
rugged_exception_check(error);
error = git_repository_odb(&odb, repo);
rugged_exception_check(error);
error = git_odb_exists_prefix(NULL, odb, &oid, RSTRING_LEN(hex));
git_odb_free(odb);
if (error == 0 || error == GIT_EAMBIGUOUS)
return Qtrue;
return Qfalse;
}
|