summaryrefslogtreecommitdiff
path: root/builtin-rerere.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2008-03-03 01:20:19 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2008-03-03 01:20:19 -0800
commitf830d45b9fdb04a5d79c25bb3a3d891d8d3b58e9 (patch)
treecfa4d86ace88be833c37498023967023bfa02743 /builtin-rerere.c
parentgit-stash: add new 'pop' subcommand (diff)
parenttests: introduce test_must_fail (diff)
downloadtgif-f830d45b9fdb04a5d79c25bb3a3d891d8d3b58e9.tar.xz
Merge commit '74359821' into js/reflog-delete
* commit '74359821': (128 commits) tests: introduce test_must_fail Fix builtin checkout crashing when given an invalid path templates/Makefile: don't depend on local umask setting Correct name of diff_flush() in API documentation Start preparing for 1.5.4.4 format-patch: remove a leftover debugging message completion: support format-patch's --cover-letter option Eliminate confusing "won't bisect on seeked tree" failure builtin-reflog.c: don't install new reflog on write failure send-email: fix In-Reply-To regression git-svn: Don't prompt for client cert password everytime. git.el: Do not display empty directories. Fix 'git cvsexportcommit -w $cvsdir ...' when used with relative $GIT_DIR Add testcase for 'git cvsexportcommit -w $cvsdir ...' with relative $GIT_DIR Prompt to continue when editing during rebase --interactive Documentation/git svn log: add a note about timezones. git-p4: Support usage of perforce client spec git-p4: git-p4 submit cleanups. git-p4: Removed git-p4 submit --direct. git-p4: Clean up git-p4 submit's log message handling. ...
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 b0c17bde87..c607aade63 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,