Sha256: bd582e5f030cee23f1dd107f609a0ef88d77e274199842ba839973bebe9e4203

Contents?: true

Size: 1009 Bytes

Versions: 4

Compression:

Stored size: 1009 Bytes

Contents

#include <git2.h>
#include <stdio.h>

int main (int argc, char** argv)
{
  git_repository *repo;
  git_index *index;
  unsigned int i, e, ecount;
  git_index_entry **entries;
  git_oid oid;

  char out[41];
  out[40] = '\0';

  git_repository_open(&repo, "/opt/libgit2-test/.git");

  git_repository_index(&index, repo);
  git_index_read(index);

  ecount = git_index_entrycount(index);
  for (i = 0; i < ecount; ++i) {
    git_index_entry *e = git_index_get(index, i);

    oid = e->oid;
    git_oid_fmt(out, &oid);

    printf("File Path: %s\n", e->path);
    printf(" Blob SHA: %s\n", out);
    printf("File Size: %d\n", (int)e->file_size);
    printf("   Device: %d\n", (int)e->dev);
    printf("    Inode: %d\n", (int)e->ino);
    printf("      UID: %d\n", (int)e->uid);
    printf("      GID: %d\n", (int)e->gid);
    printf("    ctime: %d\n", (int)e->ctime.seconds);
    printf("    mtime: %d\n", (int)e->mtime.seconds);
    printf("\n");
  }

  git_index_free(index);

  git_repository_free(repo);
}

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rugged-0.17.0b2 ext/rugged/vendor/libgit2-dist/examples/showindex.c
rugged-0.17.0b1 ext/rugged/vendor/libgit2-dist/examples/showindex.c
rugged-0.16.0 ext/rugged/vendor/libgit2-dist/examples/showindex.c
rugged-0.16.0b1 ext/rugged/vendor/libgit2-dist/examples/showindex.c