]> git.ipfire.org Git - thirdparty/git.git/blobdiff - revision.c
Merge branch 'master' of github.com:vnwildman/git
[thirdparty/git.git] / revision.c
index 8a5f866ae6a7f2757a4f91ed96207c30b3a9c8b8..0e39b2b8a59e7ab47d729602aa9bf2231691d133 100644 (file)
@@ -28,6 +28,7 @@
 #include "commit-graph.h"
 #include "prio-queue.h"
 #include "hashmap.h"
+#include "utf8.h"
 
 volatile show_early_output_fn_t show_early_output;
 
@@ -129,9 +130,7 @@ static void paths_and_oids_clear(struct hashmap *map)
        struct hashmap_iter iter;
        struct path_and_oids_entry *entry;
 
-       hashmap_for_each_entry(map, &iter, entry,
-                               struct path_and_oids_entry,
-                               ent /* member name */) {
+       hashmap_for_each_entry(map, &iter, entry, ent /* member name */) {
                oidset_clear(&entry->trees);
                free(entry->path);
        }
@@ -153,8 +152,7 @@ static void paths_and_oids_insert(struct hashmap *map,
        key.path = (char *)path;
        oidset_init(&key.trees, 0);
 
-       entry = hashmap_get_entry(map, &key, NULL,
-                               struct path_and_oids_entry, ent);
+       entry = hashmap_get_entry(map, &key, ent, NULL);
        if (!entry) {
                entry = xcalloc(1, sizeof(struct path_and_oids_entry));
                hashmap_entry_init(&entry->ent, hash);
@@ -243,9 +241,7 @@ void mark_trees_uninteresting_sparse(struct repository *r,
                add_children_by_path(r, tree, &map);
        }
 
-       hashmap_for_each_entry(&map, &map_iter, entry,
-                               struct path_and_oids_entry,
-                               ent /* member name */)
+       hashmap_for_each_entry(&map, &map_iter, entry, ent /* member name */)
                mark_trees_uninteresting_sparse(r, &entry->trees);
 
        paths_and_oids_clear(&map);
@@ -413,9 +409,7 @@ static struct commit *handle_commit(struct rev_info *revs,
                struct tag *tag = (struct tag *) object;
                if (revs->tag_objects && !(flags & UNINTERESTING))
                        add_pending_object(revs, object, tag->tag);
-               if (!tag->tagged)
-                       die("bad tag");
-               object = parse_object(revs->repo, &tag->tagged->oid);
+               object = parse_object(revs->repo, get_tagged_oid(tag));
                if (!object) {
                        if (revs->ignore_missing_links || (flags & UNINTERESTING))
                                return NULL;
@@ -2072,7 +2066,6 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg
                revs->simplify_by_decoration = 1;
                revs->limited = 1;
                revs->prune = 1;
-               load_ref_decorations(NULL, DECORATE_SHORT_REFS);
        } else if (!strcmp(arg, "--date-order")) {
                revs->sort_order = REV_SORT_BY_COMMIT_DATE;
                revs->topo_order = 1;
@@ -2532,6 +2525,7 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, struct s
        int i, flags, left, seen_dashdash, got_rev_arg = 0, revarg_opt;
        struct argv_array prune_data = ARGV_ARRAY_INIT;
        const char *submodule = NULL;
+       int seen_end_of_options = 0;
 
        if (opt)
                submodule = opt->submodule;
@@ -2561,7 +2555,7 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, struct s
                revarg_opt |= REVARG_CANNOT_BE_FILENAME;
        for (left = i = 1; i < argc; i++) {
                const char *arg = argv[i];
-               if (*arg == '-') {
+               if (!seen_end_of_options && *arg == '-') {
                        int opts;
 
                        opts = handle_revision_pseudo_opt(submodule,
@@ -2583,6 +2577,11 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, struct s
                                continue;
                        }
 
+                       if (!strcmp(arg, "--end-of-options")) {
+                               seen_end_of_options = 1;
+                               continue;
+                       }
+
                        opts = handle_revision_opt(revs, argc - i, argv + i,
                                                   &left, argv, opt);
                        if (opts > 0) {
@@ -2693,6 +2692,8 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, struct s
 
        grep_commit_pattern_type(GREP_PATTERN_TYPE_UNSPECIFIED,
                                 &revs->grep_filter);
+       if (!is_encoding_utf8(get_log_output_encoding()))
+               revs->grep_filter.ignore_locale = 1;
        compile_grep_patterns(&revs->grep_filter);
 
        if (revs->reverse && revs->reflog_info)