mrb_value
mrb_Git_MergeFileOptions_initialize(mrb_state* mrb, mrb_value self) {
  git_merge_file_options* native_object = (git_merge_file_options*)calloc(1, sizeof(git_merge_file_options));
  mruby_gift_git_merge_file_options_data_ptr(self, native_object);
  git_merge_file_init_options(native_object, GIT_MERGE_FILE_OPTIONS_VERSION);
  return self;
}
Example #2
0
File: merge.c Project: jwes/luagi
         case 'o'://urs
            *favor = GIT_MERGE_FILE_FAVOR_OURS;
            break;
         case 't'://heirs
            *favor = GIT_MERGE_FILE_FAVOR_THEIRS;
            break;
         case 'u'://nion
            *favor = GIT_MERGE_FILE_FAVOR_UNION;
            break;
      }
   }
}

static int luagi_merge_init_file_options( lua_State *L __attribute__((unused)), int index __attribute__((unused)), git_merge_file_options *opts )
{
   int ret = git_merge_file_init_options( opts, GIT_MERGE_FILE_OPTIONS_VERSION );

   lua_getfield( L, index, ANCESTOR_LABEL );
   const char *ancestor = luaL_optstring( L, -1, NULL );
   if( ancestor )
   {
      opts->ancestor_label = ancestor;
   }

   lua_getfield( L, index, OUR_LABEL );
   const char *our = luaL_optstring( L, -1, NULL );
   if( our )
   {
      opts->our_label = our;
   }