2 * Implementation of git-merge-ours.sh as builtin
4 * Copyright (c) 2007 Thomas Harning Jr
6 * Original Copyright (c) 2005 Junio C Hamano
8 * Pretend we resolved the heads, but declare our tree trumps everybody else.
10 #define USE_THE_INDEX_COMPATIBILITY_MACROS
11 #include "git-compat-util.h"
15 static const char builtin_merge_ours_usage[] =
16 "git merge-ours <base>... -- HEAD <remote>...";
18 int cmd_merge_ours(int argc, const char **argv, const char *prefix)
20 if (argc == 2 && !strcmp(argv[1], "-h"))
21 usage(builtin_merge_ours_usage);
24 * The contents of the current index becomes the tree we
25 * commit. The index must match HEAD, or this merge cannot go
29 die_errno("read_cache failed");
30 if (index_differs_from(the_repository, "HEAD", NULL, 0))