aboutsummaryrefslogtreecommitdiff
path: root/builtin-rerere.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-02-26 00:14:22 -0800
committerJunio C Hamano <gitster@pobox.com>2008-02-26 00:14:22 -0800
commit2db511fdbdbe1c8aab80f4bc13f0df037bce8a33 (patch)
tree23350997a56089356ccaeaa923a783378c198bf6 /builtin-rerere.c
parentb8d97d07fd5025232cae74cfc9a555abd9ac390e (diff)
parent81fa145917c40b68a5e2cca6afc6a10cdfdbd25b (diff)
downloadgit-2db511fdbdbe1c8aab80f4bc13f0df037bce8a33.tar.gz
git-2db511fdbdbe1c8aab80f4bc13f0df037bce8a33.tar.xz
Merge branch 'maint'
* maint: Documentation/git-am.txt: Pass -r in the example invocation of rm -f .dotest timezone_names[]: fixed the tz offset for New Zealand. filter-branch documentation: non-zero exit status in command abort the filter rev-parse: fix potential bus error with --parseopt option spec handling Use a single implementation and API for copy_file() Documentation/git-filter-branch: add a new msg-filter example Correct fast-export file mode strings to match fast-import standard
Diffstat (limited to 'builtin-rerere.c')
-rw-r--r--builtin-rerere.c19
1 files changed, 1 insertions, 18 deletions
diff --git a/builtin-rerere.c b/builtin-rerere.c
index b0c17bde8..c607aade6 100644
--- a/builtin-rerere.c
+++ b/builtin-rerere.c
@@ -267,23 +267,6 @@ static int diff_two(const char *file1, const char *label1,
return 0;
}
-static int copy_file(const char *src, const char *dest)
-{
- FILE *in, *out;
- char buffer[32768];
- int count;
-
- if (!(in = fopen(src, "r")))
- return error("Could not open %s", src);
- if (!(out = fopen(dest, "w")))
- return error("Could not open %s", dest);
- while ((count = fread(buffer, 1, sizeof(buffer), in)))
- fwrite(buffer, 1, count, out);
- fclose(in);
- fclose(out);
- return 0;
-}
-
static int do_plain_rerere(struct path_list *rr, int fd)
{
struct path_list conflict = { NULL, 0, 0, 1 };
@@ -343,7 +326,7 @@ static int do_plain_rerere(struct path_list *rr, int fd)
continue;
fprintf(stderr, "Recorded resolution for '%s'.\n", path);
- copy_file(path, rr_path(name, "postimage"));
+ copy_file(rr_path(name, "postimage"), path, 0666);
tail_optimization:
if (i < rr->nr - 1)
memmove(rr->items + i,