summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2012-11-20 16:57:16 -0800
committerBen Straub <bs@github.com>2012-11-27 13:18:28 -0800
commit9cd423583fc8ccb7402b2fb65478cc532d011abc (patch)
treef260fb04a35cb65777c1af436f65053fa4b59ae0
parent793c4385597d0786242e17c8ef37cdfa83f1865c (diff)
downloadlibgit2-9cd423583fc8ccb7402b2fb65478cc532d011abc.tar.gz
API updates for submodule.h
-rw-r--r--include/git2/submodule.h6
-rw-r--r--src/diff.c4
-rw-r--r--src/diff_output.c4
-rw-r--r--src/submodule.c16
-rw-r--r--tests-clar/submodule/lookup.c24
5 files changed, 27 insertions, 27 deletions
diff --git a/include/git2/submodule.h b/include/git2/submodule.h
index b00fad2d4..90e45cebd 100644
--- a/include/git2/submodule.h
+++ b/include/git2/submodule.h
@@ -318,7 +318,7 @@ GIT_EXTERN(int) git_submodule_set_url(git_submodule *submodule, const char *url)
* @param submodule Pointer to submodule object
* @return Pointer to git_oid or NULL if submodule is not in index.
*/
-GIT_EXTERN(const git_oid *) git_submodule_index_oid(git_submodule *submodule);
+GIT_EXTERN(const git_oid *) git_submodule_index_id(git_submodule *submodule);
/**
* Get the OID for the submodule in the current HEAD tree.
@@ -326,7 +326,7 @@ GIT_EXTERN(const git_oid *) git_submodule_index_oid(git_submodule *submodule);
* @param submodule Pointer to submodule object
* @return Pointer to git_oid or NULL if submodule is not in the HEAD.
*/
-GIT_EXTERN(const git_oid *) git_submodule_head_oid(git_submodule *submodule);
+GIT_EXTERN(const git_oid *) git_submodule_head_id(git_submodule *submodule);
/**
* Get the OID for the submodule in the current working directory.
@@ -339,7 +339,7 @@ GIT_EXTERN(const git_oid *) git_submodule_head_oid(git_submodule *submodule);
* @param submodule Pointer to submodule object
* @return Pointer to git_oid or NULL if submodule is not checked out.
*/
-GIT_EXTERN(const git_oid *) git_submodule_wd_oid(git_submodule *submodule);
+GIT_EXTERN(const git_oid *) git_submodule_wd_id(git_submodule *submodule);
/**
* Get the ignore rule for the submodule.
diff --git a/src/diff.c b/src/diff.c
index d6f5bd454..86f76f9c0 100644
--- a/src/diff.c
+++ b/src/diff.c
@@ -363,7 +363,7 @@ int git_diff__oid_for_file(
const git_oid *sm_oid;
if (!git_submodule_lookup(&sm, repo, path) &&
- (sm_oid = git_submodule_wd_oid(sm)) != NULL)
+ (sm_oid = git_submodule_wd_id(sm)) != NULL)
git_oid_cpy(oid, sm_oid);
else {
/* if submodule lookup failed probably just in an intermediate
@@ -496,7 +496,7 @@ static int maybe_modified(
/* grab OID while we are here */
if (git_oid_iszero(&nitem->oid)) {
- const git_oid *sm_oid = git_submodule_wd_oid(sub);
+ const git_oid *sm_oid = git_submodule_wd_id(sub);
if (sm_oid != NULL) {
git_oid_cpy(&noid, sm_oid);
use_noid = &noid;
diff --git a/src/diff_output.c b/src/diff_output.c
index 7873f066d..804325e47 100644
--- a/src/diff_output.c
+++ b/src/diff_output.c
@@ -287,8 +287,8 @@ static int get_workdir_sm_content(
if ((file->flags & GIT_DIFF_FILE_VALID_OID) == 0) {
const git_oid* sm_head;
- if ((sm_head = git_submodule_wd_oid(sm)) != NULL ||
- (sm_head = git_submodule_head_oid(sm)) != NULL)
+ if ((sm_head = git_submodule_wd_id(sm)) != NULL ||
+ (sm_head = git_submodule_head_id(sm)) != NULL)
{
git_oid_cpy(&file->oid, sm_head);
file->flags |= GIT_DIFF_FILE_VALID_OID;
diff --git a/src/submodule.c b/src/submodule.c
index 994ce316a..bc38f1f24 100644
--- a/src/submodule.c
+++ b/src/submodule.c
@@ -513,7 +513,7 @@ int git_submodule_set_url(git_submodule *submodule, const char *url)
return 0;
}
-const git_oid *git_submodule_index_oid(git_submodule *submodule)
+const git_oid *git_submodule_index_id(git_submodule *submodule)
{
assert(submodule);
@@ -523,7 +523,7 @@ const git_oid *git_submodule_index_oid(git_submodule *submodule)
return NULL;
}
-const git_oid *git_submodule_head_oid(git_submodule *submodule)
+const git_oid *git_submodule_head_id(git_submodule *submodule)
{
assert(submodule);
@@ -533,7 +533,7 @@ const git_oid *git_submodule_head_oid(git_submodule *submodule)
return NULL;
}
-const git_oid *git_submodule_wd_oid(git_submodule *submodule)
+const git_oid *git_submodule_wd_id(git_submodule *submodule)
{
assert(submodule);
@@ -1389,8 +1389,8 @@ cleanup:
static int submodule_index_status(unsigned int *status, git_submodule *sm)
{
- const git_oid *head_oid = git_submodule_head_oid(sm);
- const git_oid *index_oid = git_submodule_index_oid(sm);
+ const git_oid *head_oid = git_submodule_head_id(sm);
+ const git_oid *index_oid = git_submodule_index_id(sm);
if (!head_oid) {
if (index_oid)
@@ -1410,7 +1410,7 @@ static int submodule_wd_status(unsigned int *status, git_submodule *sm)
const git_oid *wd_oid, *index_oid;
git_repository *sm_repo = NULL;
- /* open repo now if we need it (so wd_oid() call won't reopen) */
+ /* open repo now if we need it (so wd_id() call won't reopen) */
if ((sm->ignore == GIT_SUBMODULE_IGNORE_NONE ||
sm->ignore == GIT_SUBMODULE_IGNORE_UNTRACKED) &&
(sm->flags & GIT_SUBMODULE_STATUS_IN_WD) != 0)
@@ -1419,8 +1419,8 @@ static int submodule_wd_status(unsigned int *status, git_submodule *sm)
return error;
}
- index_oid = git_submodule_index_oid(sm);
- wd_oid = git_submodule_wd_oid(sm);
+ index_oid = git_submodule_index_id(sm);
+ wd_oid = git_submodule_wd_id(sm);
if (!index_oid) {
if (wd_oid)
diff --git a/tests-clar/submodule/lookup.c b/tests-clar/submodule/lookup.c
index 94eb19b5e..868b51e55 100644
--- a/tests-clar/submodule/lookup.c
+++ b/tests-clar/submodule/lookup.c
@@ -62,9 +62,9 @@ void test_submodule_lookup__accessors(void)
cl_assert(git__suffixcmp(git_submodule_path(sm), "sm_unchanged") == 0);
cl_assert(git__suffixcmp(git_submodule_url(sm), "/submod2_target") == 0);
- cl_assert(git_oid_streq(git_submodule_index_oid(sm), oid) == 0);
- cl_assert(git_oid_streq(git_submodule_head_oid(sm), oid) == 0);
- cl_assert(git_oid_streq(git_submodule_wd_oid(sm), oid) == 0);
+ cl_assert(git_oid_streq(git_submodule_index_id(sm), oid) == 0);
+ cl_assert(git_oid_streq(git_submodule_head_id(sm), oid) == 0);
+ cl_assert(git_oid_streq(git_submodule_wd_id(sm), oid) == 0);
cl_assert(git_submodule_ignore(sm) == GIT_SUBMODULE_IGNORE_NONE);
cl_assert(git_submodule_update(sm) == GIT_SUBMODULE_UPDATE_CHECKOUT);
@@ -72,24 +72,24 @@ void test_submodule_lookup__accessors(void)
cl_git_pass(git_submodule_lookup(&sm, g_repo, "sm_changed_head"));
cl_assert_equal_s("sm_changed_head", git_submodule_name(sm));
- cl_assert(git_oid_streq(git_submodule_index_oid(sm), oid) == 0);
- cl_assert(git_oid_streq(git_submodule_head_oid(sm), oid) == 0);
- cl_assert(git_oid_streq(git_submodule_wd_oid(sm),
+ cl_assert(git_oid_streq(git_submodule_index_id(sm), oid) == 0);
+ cl_assert(git_oid_streq(git_submodule_head_id(sm), oid) == 0);
+ cl_assert(git_oid_streq(git_submodule_wd_id(sm),
"3d9386c507f6b093471a3e324085657a3c2b4247") == 0);
cl_git_pass(git_submodule_lookup(&sm, g_repo, "sm_added_and_uncommited"));
cl_assert_equal_s("sm_added_and_uncommited", git_submodule_name(sm));
- cl_assert(git_oid_streq(git_submodule_index_oid(sm), oid) == 0);
- cl_assert(git_submodule_head_oid(sm) == NULL);
- cl_assert(git_oid_streq(git_submodule_wd_oid(sm), oid) == 0);
+ cl_assert(git_oid_streq(git_submodule_index_id(sm), oid) == 0);
+ cl_assert(git_submodule_head_id(sm) == NULL);
+ cl_assert(git_oid_streq(git_submodule_wd_id(sm), oid) == 0);
cl_git_pass(git_submodule_lookup(&sm, g_repo, "sm_missing_commits"));
cl_assert_equal_s("sm_missing_commits", git_submodule_name(sm));
- cl_assert(git_oid_streq(git_submodule_index_oid(sm), oid) == 0);
- cl_assert(git_oid_streq(git_submodule_head_oid(sm), oid) == 0);
- cl_assert(git_oid_streq(git_submodule_wd_oid(sm),
+ cl_assert(git_oid_streq(git_submodule_index_id(sm), oid) == 0);
+ cl_assert(git_oid_streq(git_submodule_head_id(sm), oid) == 0);
+ cl_assert(git_oid_streq(git_submodule_wd_id(sm),
"5e4963595a9774b90524d35a807169049de8ccad") == 0);
}