Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'log-tree.c')
-rw-r--r--log-tree.c32
1 files changed, 19 insertions, 13 deletions
diff --git a/log-tree.c b/log-tree.c
index ccdbf08feb..1dd5fcbf7b 100644
--- a/log-tree.c
+++ b/log-tree.c
@@ -138,10 +138,12 @@ static int add_ref_decoration(const char *refname, const struct object_id *oid,
int flags UNUSED,
void *cb_data)
{
+ int i;
struct object *obj;
enum object_type objtype;
enum decoration_type deco_type = DECORATION_NONE;
struct decoration_filter *filter = (struct decoration_filter *)cb_data;
+ const char *git_replace_ref_base = ref_namespace[NAMESPACE_REPLACE].ref;
if (filter && !ref_filter_match(refname, filter))
return 0;
@@ -166,16 +168,21 @@ static int add_ref_decoration(const char *refname, const struct object_id *oid,
return 0;
obj = lookup_object_by_type(the_repository, oid, objtype);
- if (starts_with(refname, "refs/heads/"))
- deco_type = DECORATION_REF_LOCAL;
- else if (starts_with(refname, "refs/remotes/"))
- deco_type = DECORATION_REF_REMOTE;
- else if (starts_with(refname, "refs/tags/"))
- deco_type = DECORATION_REF_TAG;
- else if (!strcmp(refname, "refs/stash"))
- deco_type = DECORATION_REF_STASH;
- else if (!strcmp(refname, "HEAD"))
- deco_type = DECORATION_REF_HEAD;
+ for (i = 0; i < ARRAY_SIZE(ref_namespace); i++) {
+ struct ref_namespace_info *info = &ref_namespace[i];
+
+ if (!info->decoration)
+ continue;
+ if (info->exact) {
+ if (!strcmp(refname, info->ref)) {
+ deco_type = info->decoration;
+ break;
+ }
+ } else if (starts_with(refname, info->ref)) {
+ deco_type = info->decoration;
+ break;
+ }
+ }
add_name_decoration(deco_type, refname, obj);
while (obj->type == OBJ_TAG) {
@@ -957,8 +964,7 @@ static void cleanup_additional_headers(struct diff_options *o)
static int do_remerge_diff(struct rev_info *opt,
struct commit_list *parents,
- struct object_id *oid,
- struct commit *commit)
+ struct object_id *oid)
{
struct merge_options o;
struct commit_list *bases;
@@ -1053,7 +1059,7 @@ static int log_tree_diff(struct rev_info *opt, struct commit *commit, struct log
"for octopus merges.\n");
return 1;
}
- return do_remerge_diff(opt, parents, oid, commit);
+ return do_remerge_diff(opt, parents, oid);
}
if (opt->combine_merges)
return do_diff_combined(opt, commit);