From bac695b58c3b013a3ebbfc1909f8adb9967492f8 Mon Sep 17 00:00:00 2001 From: Ben Straub Date: Sun, 18 Nov 2012 22:20:26 -0700 Subject: Examples: fix reference names --- examples/general.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples/general.c') diff --git a/examples/general.c b/examples/general.c index 9ccb4c56e..70152d7e0 100644 --- a/examples/general.c +++ b/examples/general.c @@ -405,12 +405,12 @@ int main (int argc, char** argv) switch (git_reference_type(ref)) { case GIT_REF_OID: - git_oid_fmt(out, git_reference_oid(ref)); + git_oid_fmt(out, git_reference_target(ref)); printf("%s [%s]\n", refname, out); break; case GIT_REF_SYMBOLIC: - printf("%s => %s\n", refname, git_reference_target(ref)); + printf("%s => %s\n", refname, git_reference_symbolic_target(ref)); break; default: fprintf(stderr, "Unexpected reference type\n"); -- cgit v1.2.1 From e120123e369a036cd40b8f085cebd55463466796 Mon Sep 17 00:00:00 2001 From: Russell Belfer Date: Tue, 20 Nov 2012 14:01:46 -0800 Subject: API review / update for tree.h --- examples/general.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples/general.c') diff --git a/examples/general.c b/examples/general.c index 70152d7e0..c4ff21d8b 100644 --- a/examples/general.c +++ b/examples/general.c @@ -261,8 +261,8 @@ int main (int argc, char** argv) git_tree_lookup(&tree, repo, &oid); // Getting the count of entries in the tree so you can iterate over them if you want to. - int cnt = git_tree_entrycount(tree); // 3 - printf("tree entries: %d\n", cnt); + size_t cnt = git_tree_entrycount(tree); // 3 + printf("tree entries: %d\n", (int)cnt); entry = git_tree_entry_byindex(tree, 0); printf("Entry name: %s\n", git_tree_entry_name(entry)); // "hello.c" -- cgit v1.2.1 From 793c4385597d0786242e17c8ef37cdfa83f1865c Mon Sep 17 00:00:00 2001 From: Russell Belfer Date: Tue, 20 Nov 2012 16:36:06 -0800 Subject: Update diff callback param order This makes the diff functions that take callbacks both take the payload parameter after the callback function pointers and pass the payload as the last argument to the callback function instead of the first. This should make them consistent with other callbacks across the API. --- examples/general.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'examples/general.c') diff --git a/examples/general.c b/examples/general.c index c4ff21d8b..d9bb6c04d 100644 --- a/examples/general.c +++ b/examples/general.c @@ -298,7 +298,7 @@ int main (int argc, char** argv) // Note that this buffer may not be contain ASCII data for certain blobs (e.g. binary files): // do not consider the buffer a NULL-terminated string, and use the `git_blob_rawsize` attribute to // find out its exact size in bytes - printf("Blob Size: %ld\n", git_blob_rawsize(blob)); // 8 + printf("Blob Size: %ld\n", (long)git_blob_rawsize(blob)); // 8 git_blob_rawcontent(blob); // "content" // ### Revwalking -- cgit v1.2.1 From f45d51ff8e04c6849413c13aedcf5abacc3c69bd Mon Sep 17 00:00:00 2001 From: Ben Straub Date: Tue, 20 Nov 2012 19:57:46 -0700 Subject: API updates for index.h --- examples/general.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'examples/general.c') diff --git a/examples/general.c b/examples/general.c index d9bb6c04d..9ea264ec6 100644 --- a/examples/general.c +++ b/examples/general.c @@ -371,7 +371,7 @@ int main (int argc, char** argv) // All these properties are exported publicly in the `git_index_entry` struct ecount = git_index_entrycount(index); for (i = 0; i < ecount; ++i) { - git_index_entry *e = git_index_get_byindex(index, i); + const git_index_entry *e = git_index_get_byindex(index, i); printf("path: %s\n", e->path); printf("mtime: %d\n", (int)e->mtime.seconds); -- cgit v1.2.1