summaryrefslogtreecommitdiff
path: root/submodule.c
diff options
context:
space:
mode:
authorJacob Keller <jacob.keller@gmail.com>2016-08-31 16:27:23 -0700
committerJunio C Hamano <gitster@pobox.com>2016-08-31 18:07:10 -0700
commit602a283afb225ea094f4582e02e94cfd7f5cabf0 (patch)
tree1d85b1ee06d04791e238c036c0e222c9081e18a1 /submodule.c
parent99b43a61f2daf5fe183056e5bf2a75a8a81a28bf (diff)
downloadgit-602a283afb225ea094f4582e02e94cfd7f5cabf0.tar.gz
submodule: convert show_submodule_summary to use struct object_id *
Since we're going to be changing this function in a future patch, lets go ahead and convert this to use object_id now. Signed-off-by: Jacob Keller <jacob.keller@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'submodule.c')
-rw-r--r--submodule.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/submodule.c b/submodule.c
index 6096cf428b..7cb236b0a1 100644
--- a/submodule.c
+++ b/submodule.c
@@ -337,7 +337,7 @@ static void print_submodule_summary(struct rev_info *rev, FILE *f,
void show_submodule_summary(FILE *f, const char *path,
const char *line_prefix,
- unsigned char one[20], unsigned char two[20],
+ struct object_id *one, struct object_id *two,
unsigned dirty_submodule, const char *meta,
const char *del, const char *add, const char *reset)
{
@@ -347,14 +347,14 @@ void show_submodule_summary(FILE *f, const char *path,
struct strbuf sb = STRBUF_INIT;
int fast_forward = 0, fast_backward = 0;
- if (is_null_sha1(two))
+ if (is_null_oid(two))
message = "(submodule deleted)";
else if (add_submodule_odb(path))
message = "(not initialized)";
- else if (is_null_sha1(one))
+ else if (is_null_oid(one))
message = "(new submodule)";
- else if (!(left = lookup_commit_reference(one)) ||
- !(right = lookup_commit_reference(two)))
+ else if (!(left = lookup_commit_reference(one->hash)) ||
+ !(right = lookup_commit_reference(two->hash)))
message = "(commits not present)";
else if (prepare_submodule_summary(&rev, path, left, right,
&fast_forward, &fast_backward))
@@ -367,16 +367,16 @@ void show_submodule_summary(FILE *f, const char *path,
fprintf(f, "%sSubmodule %s contains modified content\n",
line_prefix, path);
- if (!hashcmp(one, two)) {
+ if (!oidcmp(one, two)) {
strbuf_release(&sb);
return;
}
strbuf_addf(&sb, "%s%sSubmodule %s %s..", line_prefix, meta, path,
- find_unique_abbrev(one, DEFAULT_ABBREV));
+ find_unique_abbrev(one->hash, DEFAULT_ABBREV));
if (!fast_backward && !fast_forward)
strbuf_addch(&sb, '.');
- strbuf_addf(&sb, "%s", find_unique_abbrev(two, DEFAULT_ABBREV));
+ strbuf_addf(&sb, "%s", find_unique_abbrev(two->hash, DEFAULT_ABBREV));
if (message)
strbuf_addf(&sb, " %s%s\n", message, reset);
else