summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2012-12-17 11:00:53 -0800
committerRussell Belfer <rb@github.com>2012-12-17 11:00:53 -0800
commit56c72b759c3adb92c0fdab18fccfb25fb561cd4f (patch)
tree9721502f41527e61265ae56940d30fddd5db9672 /src
parentf79535092d86b531793640834bb010fa67dd4c3c (diff)
downloadlibgit2-56c72b759c3adb92c0fdab18fccfb25fb561cd4f.tar.gz
Fix diff constructor name order confusion
The diff constructor functions had some confusing names, where the "old" side of the diff was coming after the "new" side. This reverses the order in the function name to make it less confusing. Specifically... * git_diff_index_to_tree becomes git_diff_tree_to_index * git_diff_workdir_to_index becomes git_diff_index_to_workdir * git_diff_workdir_to_tree becomes git_diff_tree_to_workdir
Diffstat (limited to 'src')
-rw-r--r--src/checkout.c2
-rw-r--r--src/diff.c6
-rw-r--r--src/stash.c6
-rw-r--r--src/status.c4
-rw-r--r--src/submodule.c4
5 files changed, 11 insertions, 11 deletions
diff --git a/src/checkout.c b/src/checkout.c
index d9f0f8fad..972366fbb 100644
--- a/src/checkout.c
+++ b/src/checkout.c
@@ -632,7 +632,7 @@ int git_checkout_index(
if (opts && opts->paths.count > 0)
diff_opts.pathspec = opts->paths;
- if ((error = git_diff_workdir_to_index(&diff, repo, index, &diff_opts)) < 0)
+ if ((error = git_diff_index_to_workdir(&diff, repo, index, &diff_opts)) < 0)
goto cleanup;
if ((error = git_buf_puts(&workdir, git_repository_workdir(repo))) < 0)
diff --git a/src/diff.c b/src/diff.c
index 822ae5b09..9c0b45f8e 100644
--- a/src/diff.c
+++ b/src/diff.c
@@ -784,7 +784,7 @@ int git_diff_tree_to_tree(
return error;
}
-int git_diff_index_to_tree(
+int git_diff_tree_to_index(
git_diff_list **diff,
git_repository *repo,
git_tree *old_tree,
@@ -806,7 +806,7 @@ int git_diff_index_to_tree(
return error;
}
-int git_diff_workdir_to_index(
+int git_diff_index_to_workdir(
git_diff_list **diff,
git_repository *repo,
git_index *index,
@@ -828,7 +828,7 @@ int git_diff_workdir_to_index(
}
-int git_diff_workdir_to_tree(
+int git_diff_tree_to_workdir(
git_diff_list **diff,
git_repository *repo,
git_tree *old_tree,
diff --git a/src/stash.c b/src/stash.c
index e32d8fa31..705fc75ea 100644
--- a/src/stash.c
+++ b/src/stash.c
@@ -251,7 +251,7 @@ static int build_untracked_tree(
if (git_commit_tree(&i_tree, i_commit) < 0)
goto cleanup;
- if (git_diff_workdir_to_tree(&diff, git_index_owner(index), i_tree, &opts) < 0)
+ if (git_diff_tree_to_workdir(&diff, git_index_owner(index), i_tree, &opts) < 0)
goto cleanup;
if (git_diff_foreach(diff, update_index_cb, NULL, NULL, &data) < 0)
@@ -323,10 +323,10 @@ static int build_workdir_tree(
if (git_commit_tree(&b_tree, b_commit) < 0)
goto cleanup;
- if (git_diff_index_to_tree(&diff, repo, b_tree, NULL, &opts) < 0)
+ if (git_diff_tree_to_index(&diff, repo, b_tree, NULL, &opts) < 0)
goto cleanup;
- if (git_diff_workdir_to_index(&diff2, repo, NULL, &opts) < 0)
+ if (git_diff_index_to_workdir(&diff2, repo, NULL, &opts) < 0)
goto cleanup;
if (git_diff_merge(diff, diff2) < 0)
diff --git a/src/status.c b/src/status.c
index 1ad835adb..115217c49 100644
--- a/src/status.c
+++ b/src/status.c
@@ -145,11 +145,11 @@ int git_status_foreach_ext(
/* TODO: support EXCLUDE_SUBMODULES flag */
if (show != GIT_STATUS_SHOW_WORKDIR_ONLY &&
- (err = git_diff_index_to_tree(&idx2head, repo, head, NULL, &diffopt)) < 0)
+ (err = git_diff_tree_to_index(&idx2head, repo, head, NULL, &diffopt)) < 0)
goto cleanup;
if (show != GIT_STATUS_SHOW_INDEX_ONLY &&
- (err = git_diff_workdir_to_index(&wd2idx, repo, NULL, &diffopt)) < 0)
+ (err = git_diff_index_to_workdir(&wd2idx, repo, NULL, &diffopt)) < 0)
goto cleanup;
usercb.cb = cb;
diff --git a/src/submodule.c b/src/submodule.c
index 3d9950d58..94b4f724e 100644
--- a/src/submodule.c
+++ b/src/submodule.c
@@ -1454,7 +1454,7 @@ static int submodule_wd_status(unsigned int *status, git_submodule *sm)
if (sm->ignore == GIT_SUBMODULE_IGNORE_NONE)
opt.flags |= GIT_DIFF_INCLUDE_UNTRACKED;
- error = git_diff_index_to_tree(&diff, sm_repo, sm_head, NULL, &opt);
+ error = git_diff_tree_to_index(&diff, sm_repo, sm_head, NULL, &opt);
if (!error) {
if (git_diff_num_deltas(diff) > 0)
@@ -1471,7 +1471,7 @@ static int submodule_wd_status(unsigned int *status, git_submodule *sm)
/* perform index-to-workdir diff on submodule */
- error = git_diff_workdir_to_index(&diff, sm_repo, NULL, &opt);
+ error = git_diff_index_to_workdir(&diff, sm_repo, NULL, &opt);
if (!error) {
size_t untracked =