blob: 0b76cc42816e1f7804df6f313f24ce9be491b6e8 [file] [log] [blame]
Junio C Hamanobe3cfa82005-04-26 09:25:05 -07001/*
2 * Copyright (C) 2005 Junio C Hamano
3 */
Junio C Hamano86436c22005-04-25 18:22:47 -07004#ifndef DIFF_H
5#define DIFF_H
6
Junio C Hamano77eb2722005-04-27 09:21:00 -07007extern void diff_addremove(int addremove,
8 unsigned mode,
9 const unsigned char *sha1,
10 const char *base,
11 const char *path);
12
13extern void diff_change(unsigned mode1, unsigned mode2,
14 const unsigned char *sha1,
15 const unsigned char *sha2,
16 const char *base, const char *path);
17
18extern void diff_unmerge(const char *path);
19
20/* These are for diff-tree-helper */
Junio C Hamano86436c22005-04-25 18:22:47 -070021
Junio C Hamanobe3cfa82005-04-26 09:25:05 -070022struct diff_spec {
Junio C Hamanob46f0b62005-05-04 01:45:24 -070023 unsigned char blob_sha1[20];
Junio C Hamanobe3cfa82005-04-26 09:25:05 -070024 unsigned short mode; /* file mode */
Junio C Hamanob46f0b62005-05-04 01:45:24 -070025 unsigned sha1_valid : 1; /* if true, use blob_sha1 and trust mode;
26 * however with a NULL SHA1, read them
27 * from the file system.
28 * if false, use the name and read mode from
Junio C Hamanobe3cfa82005-04-26 09:25:05 -070029 * the filesystem.
30 */
31 unsigned file_valid : 1; /* if false the file does not even exist */
32};
Junio C Hamano86436c22005-04-25 18:22:47 -070033
Junio C Hamanobe3cfa82005-04-26 09:25:05 -070034extern void run_external_diff(const char *name,
35 struct diff_spec *, struct diff_spec *);
Junio C Hamano86436c22005-04-25 18:22:47 -070036
37#endif /* DIFF_H */