Ejemplo n.º 1
0
static void assert_retrieval(const char *glob, int expected_count)
{
	int count = 0;

	cl_git_pass(git_reference_foreach_glob(repo, glob, count_cb, &count));

	cl_assert_equal_i(expected_count, count);
}
Ejemplo n.º 2
0
void test_refs_foreachglob__can_cancel(void)
{
	int count = 0;

	cl_assert_equal_i(GIT_EUSER, git_reference_foreach_glob(
		repo, "*", interrupt_cb, &count) );

	cl_assert_equal_i(11, count);
}
Ejemplo n.º 3
0
int luagi_reference_foreach_glob( lua_State *L )
{
   git_repository **repo = checkrepo( L, 1 );
   const char *glob = luaL_checkstring( L, 2 );
   luaL_checktype( L, 3, LUA_TFUNCTION );
   luagi_foreach_t *p = malloc( sizeof( luagi_foreach_t ) );
   p->L = L;
   p->callback_pos = 3;

   int ret = git_reference_foreach_glob( *repo, glob, name_callback, p );
   free( p );
   if( ret )
   {
      ltk_error_abort( L );
   }
   return 0;   
}