anchor.diff:    libgit2: THandle;
   
   function InitLibgit2: Boolean;
  +   function Bind(const aName: String): Pointer;
  +   begin
  +      Result := GetProcAddress(libgit2, PAnsiChar(aName));
  +      {$IFDEF DEBUG}
  +      if Result = nil then
  +         raise Exception.CreateFmt('Export [%s] not found', [aName]);
  +      {$ENDIF}
  +   end;
   begin
     if libgit2 = 0 then
     begin
       libgit2 := LoadLibrary('git2.dll');
       if libgit2 > 0 then
       begin
  -      git_repository_open           := GetProcAddress(libgit2, 'git_repository_open');
  -      git_repository_free           := GetProcAddress(libgit2, 'git_repository_free');
  -
  -      git_oid_mkstr                 := GetProcAddress(libgit2, 'git_oid_mkstr');
  -      git_oid_fmt                   := GetProcAddress(libgit2, 'git_oid_fmt');
  -      git_oid_pathfmt               := GetProcAddress(libgit2, 'git_oid_pathfmt');
  -
  -      git_commit_lookup             := GetProcAddress(libgit2, 'git_commit_lookup');
  -      git_commit_message_short      := GetProcAddress(libgit2, 'git_commit_message_short');
  -      git_commit_message            := GetProcAddress(libgit2, 'git_commit_message');
  -      git_commit_author             := GetProcAddress(libgit2, 'git_commit_author');
  -      git_commit_committer          := GetProcAddress(libgit2, 'git_commit_committer');
  -      git_commit_time               := GetProcAddress(libgit2, 'git_commit_time');
  -      git_commit_parentcount        := GetProcAddress(libgit2, 'git_commit_parentcount');
  -      git_commit_parent             := GetProcAddress(libgit2, 'git_commit_parent');
  -
  -      git_revwalk_new               := GetProcAddress(libgit2, 'git_revwalk_new');
  -      git_revwalk_free              := GetProcAddress(libgit2, 'git_revwalk_free');
  -      git_revwalk_sorting           := GetProcAddress(libgit2, 'git_revwalk_sorting');
  -      git_revwalk_push              := GetProcAddress(libgit2, 'git_revwalk_push');
  -      git_revwalk_next              := GetProcAddress(libgit2, 'git_revwalk_next');
  -
  -      git_index_open_bare           := GetProcAddress(libgit2, 'git_index_open_bare');
  -      git_index_read                := GetProcAddress(libgit2, 'git_index_read');
  -      git_index_free                := GetProcAddress(libgit2, 'git_index_free');
  -      git_index_find                := GetProcAddress(libgit2, 'git_index_find');
  -      git_index_entrycount          := GetProcAddress(libgit2, 'git_index_entrycount');
  -
  -      git_tag_lookup                := GetProcAddress(libgit2, 'git_tag_lookup');
  -      git_tag_name                  := GetProcAddress(libgit2, 'git_tag_name');
  -      git_tag_type                  := GetProcAddress(libgit2, 'git_tag_type');
  -      git_tag_target                := GetProcAddress(libgit2, 'git_tag_target');
  -      git_tag_id                    := GetProcAddress(libgit2, 'git_tag_id');
  -      git_tag_set_name              := GetProcAddress(libgit2, 'git_tag_set_name');
  -
  -      git_commit_id                 := GetProcAddress(libgit2, 'git_commit_id');
  -
  -      git_object_id                 := GetProcAddress(libgit2, 'git_object_id');
  -      git_object_write              := GetProcAddress(libgit2, 'git_object_write');
  -      git_object_free               := GetProcAddress(libgit2, 'git_object_free');
  -
  -      git_tree_lookup               := GetProcAddress(libgit2, 'git_tree_lookup');
  -      git_tree_entry_byname         := GetProcAddress(libgit2, 'git_tree_entry_byname');
  -      git_tree_entry_byindex        := GetProcAddress(libgit2, 'git_tree_entry_byindex');
  -      git_tree_entrycount           := GetProcAddress(libgit2, 'git_tree_entrycount');
  -      git_tree_entry_name           := GetProcAddress(libgit2, 'git_tree_entry_name');
  -      git_tree_entry_2object        := GetProcAddress(libgit2, 'git_tree_entry_2object');
  -      git_tree_new                  := GetProcAddress(libgit2, 'git_tree_new');
  -      git_tree_add_entry            := GetProcAddress(libgit2, 'git_tree_add_entry');
  -      git_tree_remove_entry_byindex := GetProcAddress(libgit2, 'git_tree_remove_entry_byindex');
  -      git_tree_remove_entry_byname  := GetProcAddress(libgit2, 'git_tree_remove_entry_byname');
  -      git_tree_id                   := GetProcAddress(libgit2, 'git_tree_id');
  +      git_blob_lookup                           := Bind('git_blob_lookup');
  +      git_blob_new                              := Bind('git_blob_new');
  +      git_blob_set_rawcontent_fromfile          := Bind('git_blob_set_rawcontent_fromfile');
  +      git_blob_set_rawcontent                   := Bind('git_blob_set_rawcontent');
  +      git_blob_rawcontent                       := Bind('git_blob_rawcontent');
  +      git_blob_rawsize                          := Bind('git_blob_rawsize');
  +      git_blob_writefile                        := Bind('git_blob_writefile');
  +
  +      git_commit_lookup                         := Bind('git_commit_lookup');
  +      git_commit_message_short                  := Bind('git_commit_message_short');
  +      git_commit_message                        := Bind('git_commit_message');
  +      git_commit_author                         := Bind('git_commit_author');
  +      git_commit_committer                      := Bind('git_commit_committer');
  +      git_commit_time                           := Bind('git_commit_time');
  +      git_commit_parentcount                    := Bind('git_commit_parentcount');
  +      git_commit_parent                         := Bind('git_commit_parent');
  +      git_commit_id                             := Bind('git_commit_id');
  +      git_commit_new                            := Bind('git_commit_new');
  +//      git_commit_timezone_offset                := Bind('git_commit_timezone_offset'); {TODO : libgit2 has a typo, named git_commit_time_offset in commit.c}
  +      git_commit_tree                           := Bind('git_commit_tree');
  +      git_commit_add_parent                     := Bind('git_commit_add_parent');
  +      git_commit_set_message                    := Bind('git_commit_set_message');
  +      git_commit_set_committer                  := Bind('git_commit_set_committer');
  +      git_commit_set_author                     := Bind('git_commit_set_author');
  +      git_commit_set_tree                       := Bind('git_commit_set_tree');
  +
  +      git_index_open_bare                       := Bind('git_index_open_bare');
  +      git_index_read                            := Bind('git_index_read');
  +      git_index_free                            := Bind('git_index_free');
  +      git_index_find                            := Bind('git_index_find');
  +      git_index_entrycount                      := Bind('git_index_entrycount');
  +
  +      git_index_open_inrepo                     := Bind('git_index_open_inrepo');
  +      git_index_clear                           := Bind('git_index_clear');
  +      git_index_write                           := Bind('git_index_write');
  +      git_index_add                             := Bind('git_index_add');
  +      git_index_remove                          := Bind('git_index_remove');
  +      git_index_insert                          := Bind('git_index_insert');
  +      git_index_get                             := Bind('git_index_get');
  +
  +      git_object_id                             := Bind('git_object_id');
  +      git_object_write                          := Bind('git_object_write');
  +      git_object_free                           := Bind('git_object_free');
  +      git_object_type                           := Bind('git_object_type');
  +      git_object_owner                          := Bind('git_object_owner');
  +      git_object_type2string                    := Bind('git_object_type2string');
  +      git_object_string2type                    := Bind('git_object_string2type');
  +      git_object_typeisloose                    := Bind('git_object_typeisloose');
  +
  +      git_odb_new                               := Bind('git_odb_new');
  +      git_odb_open                              := Bind('git_odb_open');
  +      git_odb_add_backend                       := Bind('git_odb_add_backend');
  +      git_odb_close                             := Bind('git_odb_close');
  +      git_odb_read                              := Bind('git_odb_read');
  +      git_odb_read_header                       := Bind('git_odb_read_header');
  +      git_odb_write                             := Bind('git_odb_write');
  +      git_odb_exists                            := Bind('git_odb_exists');
  +
  +      git_rawobj_hash                           := Bind('git_rawobj_hash');
  +      git_rawobj_close                          := Bind('git_rawobj_close');
  +
  +      git_oid_mkstr                             := Bind('git_oid_mkstr');
  +      git_oid_fmt                               := Bind('git_oid_fmt');
  +      git_oid_pathfmt                           := Bind('git_oid_pathfmt');
  +      git_oid_mkraw                             := Bind('git_oid_mkraw');
  +      git_oid_allocfmt                          := Bind('git_oid_allocfmt');
  +      git_oid_to_string                         := Bind('git_oid_to_string');
  +      git_oid_cpy                               := Bind('git_oid_cpy');
  +
  +      git_repository_open                       := Bind('git_repository_open');
  +      git_repository_free                       := Bind('git_repository_free');
  +      git_repository_open2                      := Bind('git_repository_open2');
  +      git_repository_lookup                     := Bind('git_repository_lookup');
  +      git_repository_database                   := Bind('git_repository_database');
  +      git_repository_index                      := Bind('git_repository_index');
  +      git_repository_newobject                  := Bind('git_repository_newobject');
  +      git_repository_init                       := Bind('git_repository_init');
  +
  +      git_revwalk_new                           := Bind('git_revwalk_new');
  +      git_revwalk_free                          := Bind('git_revwalk_free');
  +      git_revwalk_sorting                       := Bind('git_revwalk_sorting');
  +      git_revwalk_push                          := Bind('git_revwalk_push');
  +      git_revwalk_next                          := Bind('git_revwalk_next');
  +      git_revwalk_reset                         := Bind('git_revwalk_reset');
  +      git_revwalk_hide                          := Bind('git_revwalk_hide');
  +      git_revwalk_repository                    := Bind('git_revwalk_repository');
  +
  +      git_signature_new                         := Bind('git_signature_new');
  +      git_signature_dup                         := Bind('git_signature_dup');
  +      git_signature_free                        := Bind('git_signature_free');
  +
  +      git_tag_lookup                            := Bind('git_tag_lookup');
  +      git_tag_name                              := Bind('git_tag_name');
  +      git_tag_type                              := Bind('git_tag_type');
  +      git_tag_target                            := Bind('git_tag_target');
  +      git_tag_id                                := Bind('git_tag_id');
  +      git_tag_set_name                          := Bind('git_tag_set_name');
  +      git_tag_new                               := Bind('git_tag_new');
  +      git_tag_tagger                            := Bind('git_tag_tagger');
  +      git_tag_message                           := Bind('git_tag_message');
  +      git_tag_set_target                        := Bind('git_tag_set_target');
  +      git_tag_set_tagger                        := Bind('git_tag_set_tagger');
  +      git_tag_set_message                       := Bind('git_tag_set_message');
  +
  +      git_tree_lookup                           := Bind('git_tree_lookup');
  +      git_tree_entry_byname                     := Bind('git_tree_entry_byname');
  +      git_tree_entry_byindex                    := Bind('git_tree_entry_byindex');
  +      git_tree_entrycount                       := Bind('git_tree_entrycount');
  +      git_tree_entry_name                       := Bind('git_tree_entry_name');
  +      git_tree_entry_2object                    := Bind('git_tree_entry_2object');
  +      git_tree_new                              := Bind('git_tree_new');
  +      git_tree_add_entry                        := Bind('git_tree_add_entry');
  +      git_tree_remove_entry_byindex             := Bind('git_tree_remove_entry_byindex');
  +      git_tree_remove_entry_byname              := Bind('git_tree_remove_entry_byname');
  +      git_tree_id                               := Bind('git_tree_id');
  +
  +      git_tree_entry_attributes                 := Bind('git_tree_entry_attributes');
  +      git_tree_entry_id                         := Bind('git_tree_entry_id');
  +      git_tree_entry_set_id                     := Bind('git_tree_entry_set_id');
  +      git_tree_entry_set_name                   := Bind('git_tree_entry_set_name');
  +      git_tree_entry_set_attributes             := Bind('git_tree_entry_set_attributes');
       end;
     end;
   
  
positive.code:     FreeLibrary(libgit2);
      libgit2 := 0;
  
      git_repository_open             := nil;
      git_repository_free             := nil;
  
      git_oid_mkstr                   := nil;
      git_oid_fmt                     := nil;
      git_oid_pathfmt                 := nil;
  
      git_commit_lookup               := nil;
      git_commit_message_short        := nil;
      git_commit_message              := nil;
      git_commit_author               := nil;
      git_commit_committer            := nil;
      git_commit_time                 := nil;
      git_commit_parentcount          := nil;
      git_commit_parent               := nil;
  
      git_revwalk_new                 := nil;
      git_revwalk_free                := nil;
      git_revwalk_sorting             := nil;
      git_revwalk_push                := nil;
      git_revwalk_next                := nil;
  
      git_index_open_bare             := nil;
      git_index_read                  := nil;
      git_index_free                  := nil;
      git_index_find                  := nil;
      git_index_entrycount            := nil;
  
      git_tag_lookup                  := nil;
      git_tag_name                    := nil;
      git_tag_type                    := nil;
      git_tag_target                  := nil;
      git_tag_id                      := nil;
      git_tag_set_name                := nil;
  
      git_commit_id                   := nil;
  
      git_object_id                   := nil;
      git_object_write                := nil;
      git_object_free                 := nil;
  
      git_tree_lookup                 := nil;
      git_tree_entry_byname           := nil;
      git_tree_entry_byindex          := nil;
      git_tree_entrycount             := nil;
      git_tree_entry_name             := nil;
      git_tree_entry_2object          := nil;
      git_tree_new                    := nil;
      git_tree_add_entry              := nil;
      git_tree_remove_entry_byindex   := nil;
      git_tree_remove_entry_byname    := nil;
      git_tree_id                     := nil;
    end;
  end;
  
  
negative.code: interface
  
  uses
     SysUtils, Windows;
  
  function InitLibgit2: Boolean;
  
  