Skip to content

Commit

Permalink
sparse: Fix an "symbol 'merge_file' not decared" warning
Browse files Browse the repository at this point in the history
In order to fix the warning, we add a new "merge-file.h" header
containing the extern declaration of the merge_file() function,
and include the header in the source files that require the
declaration.

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Ramsay Jones authored and gitster committed Apr 11, 2011
1 parent c8f1444 commit 1e0f8c4
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions Makefile
Expand Up @@ -525,6 +525,7 @@ LIB_H += list-objects.h
LIB_H += ll-merge.h
LIB_H += log-tree.h
LIB_H += mailmap.h
LIB_H += merge-file.h
LIB_H += merge-recursive.h
LIB_H += notes.h
LIB_H += notes-cache.h
Expand Down
3 changes: 1 addition & 2 deletions builtin/merge-tree.c
Expand Up @@ -3,6 +3,7 @@
#include "xdiff-interface.h"
#include "blob.h"
#include "exec_cmd.h"
#include "merge-file.h"

static const char merge_tree_usage[] = "git merge-tree <base-tree> <branch1> <branch2>";
static int resolve_directories = 1;
Expand Down Expand Up @@ -54,8 +55,6 @@ static const char *explanation(struct merge_list *entry)
return "removed in remote";
}

extern void *merge_file(const char *, struct blob *, struct blob *, struct blob *, unsigned long *);

static void *result(struct merge_list *entry, unsigned long *size)
{
enum object_type type;
Expand Down
1 change: 1 addition & 0 deletions merge-file.c
Expand Up @@ -3,6 +3,7 @@
#include "xdiff-interface.h"
#include "ll-merge.h"
#include "blob.h"
#include "merge-file.h"

static int fill_mmfile_blob(mmfile_t *f, struct blob *obj)
{
Expand Down
7 changes: 7 additions & 0 deletions merge-file.h
@@ -0,0 +1,7 @@
#ifndef MERGE_FILE_H
#define MERGE_FILE_H

extern void *merge_file(const char *path, struct blob *base, struct blob *our,
struct blob *their, unsigned long *size);

#endif

0 comments on commit 1e0f8c4

Please sign in to comment.