]> git.ipfire.org Git - thirdparty/git.git/blobdiff - add-patch.c
object-name.h: move declarations for object-name.c functions from cache.h
[thirdparty/git.git] / add-patch.c
index a86a92e16461384cbe8ac880fa6515e0f74e243c..b01ba8fa81d6647bf1625f5cc81a78ac9846b2a0 100644 (file)
@@ -1,5 +1,10 @@
 #include "cache.h"
 #include "add-interactive.h"
+#include "advice.h"
+#include "alloc.h"
+#include "environment.h"
+#include "gettext.h"
+#include "object-name.h"
 #include "strbuf.h"
 #include "run-command.h"
 #include "strvec.h"
@@ -414,7 +419,7 @@ static int parse_diff(struct add_p_state *s, const struct pathspec *ps)
                strvec_push(&args,
                            /* could be on an unborn branch */
                            !strcmp("HEAD", s->revision) &&
-                           get_oid("HEAD", &oid) ?
+                           repo_get_oid(the_repository, "HEAD", &oid) ?
                            empty_tree_oid_hex() : s->revision);
        }
        color_arg_index = args.nr;
@@ -483,7 +488,8 @@ static int parse_diff(struct add_p_state *s, const struct pathspec *ps)
                if (!eol)
                        eol = pend;
 
-               if (starts_with(p, "diff ")) {
+               if (starts_with(p, "diff ") ||
+                   starts_with(p, "* Unmerged path ")) {
                        complete_file(marker, hunk);
                        ALLOC_GROW_BY(s->file_diff, s->file_diff_nr, 1,
                                   file_diff_alloc);