diff options
author | Russell Belfer <rb@github.com> | 2013-12-10 16:02:24 -0800 |
---|---|---|
committer | Russell Belfer <rb@github.com> | 2013-12-11 10:57:51 -0800 |
commit | 8f1066a05f15ce0e3f91614cf9915162ce6447ee (patch) | |
tree | e788fb7b74efe4fbc89bd656427ac2df5450c9cd /src/clone.c | |
parent | cbd048969e2d53790472118bf2d337cd1d90ca94 (diff) | |
download | libgit2-8f1066a05f15ce0e3f91614cf9915162ce6447ee.tar.gz |
Update clone doc and tests for callback return val
Clone callbacks can return non-zero values to cancel the clone.
This adds some tests to verify that this actually works and updates
the documentation to be clearer that this can happen and that the
return value will be propagated back by the clone function.
Diffstat (limited to 'src/clone.c')
-rw-r--r-- | src/clone.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/clone.c b/src/clone.c index ffbe8f8af..828c47ffb 100644 --- a/src/clone.c +++ b/src/clone.c @@ -408,9 +408,10 @@ int git_clone( git_remote_free(origin); } - if (error < 0) { + if (error != 0) { git_repository_free(repo); repo = NULL; + (void)git_futils_rmdir_r(local_path, NULL, rmdir_flags); } |