#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);
* Bind merge.
*
* Keep the index entries at stage0, collapse stage1 but make sure
- * stage0 does not have anything in prefix.
+ * stage0 does not have anything there.
*/
static int bind_merge(struct cache_entry **src)
{
if (merge_size != 1)
return error("Cannot do a bind merge of %d trees\n",
merge_size);
- if (!a)
- return merged_entry(old, NULL);
- if (old)
+ if (a && old)
die("Entry '%s' overlaps. Cannot bind.", a->name);
-
- return merged_entry(a, NULL);
+ if (!a)
+ return keep_entry(old);
+ else
+ return merged_entry(a, NULL);
}
/*
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;