diff options
author | Vicent Martà <vicent@github.com> | 2012-12-04 14:47:25 -0800 |
---|---|---|
committer | Vicent Martà <vicent@github.com> | 2012-12-04 14:47:25 -0800 |
commit | 16e6cee2fdfa724e91f8656ad64ec87bd24fe184 (patch) | |
tree | 28a6148bd3a9055618378797693e53faef935f17 | |
parent | 46e4227695dceabfa7d2d4ae19d486969ba6f8df (diff) | |
parent | aab8f5af4b594398356b47c0c2a2ce6f5a4ca080 (diff) | |
download | libgit2-16e6cee2fdfa724e91f8656ad64ec87bd24fe184.tar.gz |
Merge pull request #1119 from ethomson/symlink_cast_ouch
Hey that's not an int!
-rw-r--r-- | src/checkout.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/checkout.c b/src/checkout.c index a3166bfa5..cec52c536 100644 --- a/src/checkout.c +++ b/src/checkout.c @@ -203,21 +203,25 @@ static int checkout_blob( return error; } -static int retrieve_symlink_caps(git_repository *repo, bool *can_symlink) +static int retrieve_symlink_caps(git_repository *repo, bool *out) { git_config *cfg; + int can_symlink = 0; int error; if (git_repository_config__weakptr(&cfg, repo) < 0) return -1; - error = git_config_get_bool((int *)can_symlink, cfg, "core.symlinks"); + error = git_config_get_bool(&can_symlink, cfg, "core.symlinks"); /* If "core.symlinks" is not found anywhere, default to true. */ if (error == GIT_ENOTFOUND) { - *can_symlink = true; + can_symlink = true; error = 0; } + + if (error >= 0) + *out = can_symlink; return error; } |