diff --git a/read-tree.c b/read-tree.c
index e926e4c880363469c5abf766127acc466fb5e438..e16e91b173163f2b514e965d5e5ba7b939ffa1de 100644 (file)
--- a/read-tree.c
+++ b/read-tree.c
#include <sys/time.h>
#include <signal.h>
#include <sys/time.h>
#include <signal.h>
+static int reset = 0;
static int merge = 0;
static int update = 0;
static int index_only = 0;
static int merge = 0;
static int update = 0;
static int index_only = 0;
return;
errno = 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 (errno == ENOENT)
return;
die("Entry '%s' not uptodate. Cannot merge.", ce->name);
merge_size);
if (!a)
merge_size);
if (!a)
- return 0;
+ return deleted_entry(old, NULL);
if (old && same(old, a)) {
if (old && same(old, a)) {
+ 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);
return keep_entry(old);
}
return merged_entry(a, NULL);
int main(int argc, char **argv)
{
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;
unsigned char sha1[20];
merge_fn_t fn = NULL;