Merge branch 'rs/mailinfo-format-flowed'
[gitweb.git] / builtin / am.c
index 2c19e69f585a46330718ddea1c13a095cefe9d19..5e643e2a3e3d70d9c674d3edab2eb1f2f08f3392 100644 (file)
@@ -1244,6 +1244,10 @@ static int parse_mail(struct am_state *state, const char *mail)
        fclose(mi.input);
        fclose(mi.output);
 
+       if (mi.format_flowed)
+               warning(_("Patch sent with format=flowed; "
+                         "space at the end of lines might be lost."));
+
        /* Extract message and author information */
        fp = xfopen(am_path(state, "info"), "r");
        while (!strbuf_getline_lf(&sb, fp)) {
@@ -1464,7 +1468,7 @@ static int run_apply(const struct am_state *state, const char *index_file)
        int force_apply = 0;
        int options = 0;
 
-       if (init_apply_state(&apply_state, NULL))
+       if (init_apply_state(&apply_state, the_repository, NULL))
                BUG("init_apply_state() failed");
 
        argv_array_push(&apply_opts, "apply");
@@ -1598,6 +1602,7 @@ static int fall_back_threeway(const struct am_state *state, const char *index_pa
        o.branch1 = "HEAD";
        their_tree_name = xstrfmt("%.*s", linelen(state->msg), state->msg);
        o.branch2 = their_tree_name;
+       o.detect_directory_renames = 0;
 
        if (state->quiet)
                o.verbosity = 0;
@@ -2077,7 +2082,7 @@ static int safe_to_abort(const struct am_state *state)
        if (get_oid("HEAD", &head))
                oidclr(&head);
 
-       if (!oidcmp(&head, &abort_safety))
+       if (oideq(&head, &abort_safety))
                return 1;
 
        warning(_("You seem to have moved HEAD since the last 'am' failure.\n"