Merge branch 'sb/atomic-push'
[gitweb.git] / builtin / blame.c
index 17d30d00aa3f6c4d0f62cae6603f9003dd2f2395..0374fe8056acfe193d2cbd5c553b3de889b788fe 100644 (file)
@@ -2286,7 +2286,7 @@ static struct commit *fake_working_tree_commit(struct diff_options *opt,
        commit->date = now;
        parent_tail = &commit->parents;
 
-       if (!resolve_ref_unsafe("HEAD", head_sha1, 1, NULL))
+       if (!resolve_ref_unsafe("HEAD", RESOLVE_REF_READING, head_sha1, NULL))
                die("no such ref: HEAD");
 
        parent_tail = append_parent(parent_tail, head_sha1);
@@ -2390,7 +2390,7 @@ static struct commit *fake_working_tree_commit(struct diff_options *opt,
        return commit;
 }
 
-static const char *prepare_final(struct scoreboard *sb)
+static char *prepare_final(struct scoreboard *sb)
 {
        int i;
        const char *final_commit_name = NULL;
@@ -2415,10 +2415,10 @@ static const char *prepare_final(struct scoreboard *sb)
                sb->final = (struct commit *) obj;
                final_commit_name = revs->pending.objects[i].name;
        }
-       return final_commit_name;
+       return xstrdup_or_null(final_commit_name);
 }
 
-static const char *prepare_initial(struct scoreboard *sb)
+static char *prepare_initial(struct scoreboard *sb)
 {
        int i;
        const char *final_commit_name = NULL;
@@ -2445,7 +2445,7 @@ static const char *prepare_initial(struct scoreboard *sb)
        }
        if (!final_commit_name)
                die("No commit to dig down to?");
-       return final_commit_name;
+       return xstrdup(final_commit_name);
 }
 
 static int blame_copy_callback(const struct option *option, const char *arg, int unset)
@@ -2489,7 +2489,7 @@ int cmd_blame(int argc, const char **argv, const char *prefix)
        struct origin *o;
        struct blame_entry *ent = NULL;
        long dashdash_pos, lno;
-       const char *final_commit_name = NULL;
+       char *final_commit_name = NULL;
        enum object_type type;
 
        static struct string_list range_list;
@@ -2580,6 +2580,9 @@ int cmd_blame(int argc, const char **argv, const char *prefix)
        case DATE_RFC2822:
                blame_date_width = sizeof("Thu, 19 Oct 2006 16:00:04 -0700");
                break;
+       case DATE_ISO8601_STRICT:
+               blame_date_width = sizeof("2006-10-19T16:00:04-07:00");
+               break;
        case DATE_ISO8601:
                blame_date_width = sizeof("2006-10-19 16:00:04 -0700");
                break;
@@ -2700,7 +2703,7 @@ int cmd_blame(int argc, const char **argv, const char *prefix)
         * uninteresting.
         */
        if (prepare_revision_walk(&revs))
-               die("revision walk setup failed");
+               die(_("revision walk setup failed"));
 
        if (is_null_sha1(sb.final->object.sha1)) {
                o = sb.final->util;
@@ -2783,6 +2786,8 @@ int cmd_blame(int argc, const char **argv, const char *prefix)
 
        assign_blame(&sb, opt);
 
+       free(final_commit_name);
+
        if (incremental)
                return 0;