summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorBen Straub <bstraub@github.com>2012-07-17 08:08:34 -0700
committerBen Straub <bstraub@github.com>2012-07-17 08:08:34 -0700
commitbfc65634050dc52e3ed6b4497ebbb511e39d6e1e (patch)
tree32b03847b8a152b69bc3b48b6bb32e7b8621f45e /examples
parent1d68fcd04b21a2c5665d0ca6a5543e7166c73457 (diff)
parentea5d2ce4cfa6cec89e2d844a70d1eb24bb401c7d (diff)
downloadlibgit2-bfc65634050dc52e3ed6b4497ebbb511e39d6e1e.tar.gz
Merge branch 'development' into clone
Diffstat (limited to 'examples')
-rw-r--r--examples/README.md11
-rw-r--r--examples/network/Makefile2
-rw-r--r--examples/network/fetch.c1
-rw-r--r--examples/network/index-pack.c2
4 files changed, 14 insertions, 2 deletions
diff --git a/examples/README.md b/examples/README.md
new file mode 100644
index 000000000..f2b6d7d23
--- /dev/null
+++ b/examples/README.md
@@ -0,0 +1,11 @@
+libgit2 examples
+================
+
+These examples are meant as thin, easy-to-read snippets for Docurium
+(https://github.com/github/docurium) rather than full-blown
+implementations of Git commands. They are not vetted as carefully
+for bugs, error handling, or cross-platform compatibility as the
+rest of the code in libgit2, so copy with some caution.
+
+For HTML versions, check "Examples" at http://libgit2.github.com/libgit2
+
diff --git a/examples/network/Makefile b/examples/network/Makefile
index c21869ac9..9afd49e5d 100644
--- a/examples/network/Makefile
+++ b/examples/network/Makefile
@@ -2,7 +2,7 @@ default: all
CC = gcc
CFLAGS += -g
-CFLAGS += -I../../include -L../../ -lgit2 -lpthread
+CFLAGS += -I../../include -L../../build -L../.. -lgit2 -lpthread
OBJECTS = \
git2.o \
diff --git a/examples/network/fetch.c b/examples/network/fetch.c
index 8dcb81b1f..d2752124d 100644
--- a/examples/network/fetch.c
+++ b/examples/network/fetch.c
@@ -91,6 +91,7 @@ int fetch(git_repository *repo, int argc, char **argv)
usleep(10000);
printf("\rReceived %d/%d objects in %d bytes", stats.processed, stats.total, bytes);
} while (!data.finished);
+
printf("\rReceived %d/%d objects in %d bytes\n", stats.processed, stats.total, bytes);
// Disconnect the underlying connection to prevent from idling.
diff --git a/examples/network/index-pack.c b/examples/network/index-pack.c
index 5824fc555..ef5a35957 100644
--- a/examples/network/index-pack.c
+++ b/examples/network/index-pack.c
@@ -25,7 +25,7 @@ int index_pack(git_repository *repo, int argc, char **argv)
return EXIT_FAILURE;
}
- if (git_indexer_stream_new(&idx, ".git") < 0) {
+ if (git_indexer_stream_new(&idx, ".") < 0) {
puts("bad idx");
return -1;
}