summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 613f027)
raw | patch | inline | side by side (parent: 613f027)
author | Linus Torvalds <torvalds@osdl.org> | |
Mon, 15 May 2006 15:09:31 +0000 (08:09 -0700) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Mon, 15 May 2006 19:23:04 +0000 (12:23 -0700) |
The previous commit makes -u to mean "I do want to remove the
local changes, just update it from the read tree" only for
one-way merge. It makes sense to have it depend on the
"--reset" flag instead.
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
local changes, just update it from the read tree" only for
one-way merge. It makes sense to have it depend on the
"--reset" flag instead.
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
read-tree.c | patch | blob | history |
diff --git a/read-tree.c b/read-tree.c
index 59b6a6bff9bc0b2dc7c922bf8e8b16cf36573fc7..e16e91b173163f2b514e965d5e5ba7b939ffa1de 100644 (file)
--- a/read-tree.c
+++ b/read-tree.c
#include <sys/time.h>
#include <signal.h>
+static int reset = 0;
static int merge = 0;
static int update = 0;
static int index_only = 0;
return;
errno = 0;
}
+ if (reset) {
+ ce->ce_flags |= htons(CE_UPDATE);
+ return;
+ }
if (errno == ENOENT)
return;
die("Entry '%s' not uptodate. Cannot merge.", ce->name);
if (!a)
return deleted_entry(old, NULL);
if (old && same(old, a)) {
- struct stat st;
- if (lstat(old->name, &st) || ce_match_stat(old, &st, 1))
- old->ce_flags |= htons(CE_UPDATE);
+ if (reset) {
+ struct stat st;
+ if (lstat(old->name, &st) ||
+ ce_match_stat(old, &st, 1))
+ old->ce_flags |= htons(CE_UPDATE);
+ }
return keep_entry(old);
}
return merged_entry(a, NULL);
int main(int argc, char **argv)
{
- int i, newfd, reset, stage = 0;
+ int i, newfd, stage = 0;
unsigned char sha1[20];
merge_fn_t fn = NULL;