summaryrefslogtreecommitdiff
path: root/examples/diff.c
diff options
context:
space:
mode:
authorVicent Martí <vicent@github.com>2012-12-17 11:10:25 -0800
committerVicent Martí <vicent@github.com>2012-12-17 11:10:25 -0800
commite62171e2fc1b101512a7e86f6d990a38b78ed12b (patch)
tree8b3bc83ff2ad15ec3f1c88589482b839ef9414c3 /examples/diff.c
parent0d10e79dd9b4c5dee72066526a6a3c99e19c545b (diff)
parentba084f7aaf431f96588b13551ebfdffdd3eb44dc (diff)
downloadlibgit2-e62171e2fc1b101512a7e86f6d990a38b78ed12b.tar.gz
Merge pull request #1151 from arrbee/fix-diff-constructor-names
Fix diff constructor names
Diffstat (limited to 'examples/diff.c')
-rw-r--r--examples/diff.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/examples/diff.c b/examples/diff.c
index b81a8682a..63956aa4e 100644
--- a/examples/diff.c
+++ b/examples/diff.c
@@ -110,12 +110,12 @@ static int check_uint16_param(const char *arg, const char *pattern, uint16_t *va
return 1;
}
-static int check_str_param(const char *arg, const char *pattern, char **val)
+static int check_str_param(const char *arg, const char *pattern, const char **val)
{
size_t len = strlen(pattern);
if (strncmp(arg, pattern, len))
return 0;
- *val = (char *)(arg + len);
+ *val = (const char *)(arg + len);
return 1;
}
@@ -206,20 +206,20 @@ int main(int argc, char *argv[])
if (t1 && t2)
check(git_diff_tree_to_tree(&diff, repo, t1, t2, &opts), "Diff");
else if (t1 && cached)
- check(git_diff_index_to_tree(&diff, repo, t1, NULL, &opts), "Diff");
+ check(git_diff_tree_to_index(&diff, repo, t1, NULL, &opts), "Diff");
else if (t1) {
git_diff_list *diff2;
- check(git_diff_index_to_tree(&diff, repo, t1, NULL, &opts), "Diff");
- check(git_diff_workdir_to_index(&diff2, repo, NULL, &opts), "Diff");
+ check(git_diff_tree_to_index(&diff, repo, t1, NULL, &opts), "Diff");
+ check(git_diff_index_to_workdir(&diff2, repo, NULL, &opts), "Diff");
check(git_diff_merge(diff, diff2), "Merge diffs");
git_diff_list_free(diff2);
}
else if (cached) {
check(resolve_to_tree(repo, "HEAD", &t1), "looking up HEAD");
- check(git_diff_index_to_tree(&diff, repo, t1, NULL, &opts), "Diff");
+ check(git_diff_tree_to_index(&diff, repo, t1, NULL, &opts), "Diff");
}
else
- check(git_diff_workdir_to_index(&diff, repo, NULL, &opts), "Diff");
+ check(git_diff_index_to_workdir(&diff, repo, NULL, &opts), "Diff");
if (color >= 0)
fputs(colors[0], stdout);