summaryrefslogtreecommitdiff
path: root/submodule.c
diff options
context:
space:
mode:
Diffstat (limited to 'submodule.c')
-rw-r--r--submodule.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/submodule.c b/submodule.c
index b03e5f5..9a50168 100644
--- a/submodule.c
+++ b/submodule.c
@@ -541,9 +541,9 @@ static void show_submodule_header(struct diff_options *o, const char *path,
output_header:
strbuf_addf(&sb, "Submodule %s ", path);
- strbuf_add_unique_abbrev(&sb, one->hash, DEFAULT_ABBREV);
+ strbuf_add_unique_abbrev(&sb, one, DEFAULT_ABBREV);
strbuf_addstr(&sb, (fast_backward || fast_forward) ? ".." : "...");
- strbuf_add_unique_abbrev(&sb, two->hash, DEFAULT_ABBREV);
+ strbuf_add_unique_abbrev(&sb, two, DEFAULT_ABBREV);
if (message)
strbuf_addf(&sb, " %s\n", message);
else
@@ -591,7 +591,7 @@ void show_submodule_inline_diff(struct diff_options *o, const char *path,
struct object_id *one, struct object_id *two,
unsigned dirty_submodule)
{
- const struct object_id *old = the_hash_algo->empty_tree, *new = the_hash_algo->empty_tree;
+ const struct object_id *old_oid = the_hash_algo->empty_tree, *new_oid = the_hash_algo->empty_tree;
struct commit *left = NULL, *right = NULL;
struct commit_list *merge_bases = NULL;
struct child_process cp = CHILD_PROCESS_INIT;
@@ -606,9 +606,9 @@ void show_submodule_inline_diff(struct diff_options *o, const char *path,
goto done;
if (left)
- old = one;
+ old_oid = one;
if (right)
- new = two;
+ new_oid = two;
cp.git_cmd = 1;
cp.dir = path;
@@ -631,7 +631,7 @@ void show_submodule_inline_diff(struct diff_options *o, const char *path,
argv_array_pushf(&cp.args, "--dst-prefix=%s%s/",
o->b_prefix, path);
}
- argv_array_push(&cp.args, oid_to_hex(old));
+ argv_array_push(&cp.args, oid_to_hex(old_oid));
/*
* If the submodule has modified content, we will diff against the
* work tree, under the assumption that the user has asked for the
@@ -639,7 +639,7 @@ void show_submodule_inline_diff(struct diff_options *o, const char *path,
* haven't yet been committed to the submodule yet.
*/
if (!(dirty_submodule & DIRTY_SUBMODULE_MODIFIED))
- argv_array_push(&cp.args, oid_to_hex(new));
+ argv_array_push(&cp.args, oid_to_hex(new_oid));
prepare_submodule_repo_env(&cp.env_array);
if (start_command(&cp))
@@ -818,7 +818,7 @@ static int check_has_commit(const struct object_id *oid, void *data)
{
struct has_commit_data *cb = data;
- enum object_type type = sha1_object_info(oid->hash, NULL);
+ enum object_type type = oid_object_info(oid, NULL);
switch (type) {
case OBJ_COMMIT:
@@ -832,7 +832,7 @@ static int check_has_commit(const struct object_id *oid, void *data)
return 0;
default:
die(_("submodule entry '%s' (%s) is a %s, not a commit"),
- cb->path, oid_to_hex(oid), typename(type));
+ cb->path, oid_to_hex(oid), type_name(type));
}
}
@@ -1579,8 +1579,8 @@ static void submodule_reset_index(const char *path)
* pass NULL for old or new respectively.
*/
int submodule_move_head(const char *path,
- const char *old,
- const char *new,
+ const char *old_head,
+ const char *new_head,
unsigned flags)
{
int ret = 0;
@@ -1601,7 +1601,7 @@ int submodule_move_head(const char *path,
else
error_code_ptr = NULL;
- if (old && !is_submodule_populated_gently(path, error_code_ptr))
+ if (old_head && !is_submodule_populated_gently(path, error_code_ptr))
return 0;
sub = submodule_from_path(&null_oid, path);
@@ -1609,14 +1609,14 @@ int submodule_move_head(const char *path,
if (!sub)
die("BUG: could not get submodule information for '%s'", path);
- if (old && !(flags & SUBMODULE_MOVE_HEAD_FORCE)) {
+ if (old_head && !(flags & SUBMODULE_MOVE_HEAD_FORCE)) {
/* Check if the submodule has a dirty index. */
if (submodule_has_dirty_index(sub))
return error(_("submodule '%s' has dirty index"), path);
}
if (!(flags & SUBMODULE_MOVE_HEAD_DRY_RUN)) {
- if (old) {
+ if (old_head) {
if (!submodule_uses_gitfile(path))
absorb_git_dir_into_superproject("", path,
ABSORB_GITDIR_RECURSE_SUBMODULES);
@@ -1630,7 +1630,7 @@ int submodule_move_head(const char *path,
submodule_reset_index(path);
}
- if (old && (flags & SUBMODULE_MOVE_HEAD_FORCE)) {
+ if (old_head && (flags & SUBMODULE_MOVE_HEAD_FORCE)) {
char *gitdir = xstrfmt("%s/modules/%s",
get_git_common_dir(), sub->name);
connect_work_tree_and_git_dir(path, gitdir);
@@ -1659,9 +1659,9 @@ int submodule_move_head(const char *path,
argv_array_push(&cp.args, "-m");
if (!(flags & SUBMODULE_MOVE_HEAD_FORCE))
- argv_array_push(&cp.args, old ? old : EMPTY_TREE_SHA1_HEX);
+ argv_array_push(&cp.args, old_head ? old_head : EMPTY_TREE_SHA1_HEX);
- argv_array_push(&cp.args, new ? new : EMPTY_TREE_SHA1_HEX);
+ argv_array_push(&cp.args, new_head ? new_head : EMPTY_TREE_SHA1_HEX);
if (run_command(&cp)) {
ret = -1;
@@ -1669,7 +1669,7 @@ int submodule_move_head(const char *path,
}
if (!(flags & SUBMODULE_MOVE_HEAD_DRY_RUN)) {
- if (new) {
+ if (new_head) {
child_process_init(&cp);
/* also set the HEAD accordingly */
cp.git_cmd = 1;
@@ -1678,7 +1678,7 @@ int submodule_move_head(const char *path,
prepare_submodule_repo_env(&cp.env_array);
argv_array_pushl(&cp.args, "update-ref", "HEAD",
- "--no-deref", new, NULL);
+ "--no-deref", new_head, NULL);
if (run_command(&cp)) {
ret = -1;