if (unpack_trees_rec(subposns, len, newbase, fn,
indpos))
return -1;
if (unpack_trees_rec(subposns, len, newbase, fn,
indpos))
return -1;
if (unpack_trees_rec(posns, len, "", fn, &indpos))
return -1;
if (unpack_trees_rec(posns, len, "", fn, &indpos))
return -1;
if (!lstat(ce->name, &st)) {
unsigned changed = ce_match_stat(ce, &st);
if (!changed)
if (!lstat(ce->name, &st)) {
unsigned changed = ce_match_stat(ce, &st);
if (!changed)
static void show_stage_entry(FILE *o,
const char *label, const struct cache_entry *ce)
{
static void show_stage_entry(FILE *o,
const char *label, const struct cache_entry *ce)
{
- fprintf(stderr, "%s%06o %s %d\t%s\n",
- label,
- ntohl(ce->ce_mode),
- sha1_to_hex(ce->sha1),
- ce_stage(ce),
- ce->name);
+ if (!ce)
+ fprintf(o, "%s (missing)\n", label);
+ else
+ fprintf(o, "%s%06o %s %d\t%s\n",
+ label,
+ ntohl(ce->ce_mode),
+ sha1_to_hex(ce->sha1),
+ ce_stage(ce),
+ ce->name);
/* #2, #3, #4, #6, #7, #9, #11. */
count = 0;
if (!head_match || !remote_match) {
/* #2, #3, #4, #6, #7, #9, #11. */
count = 0;
if (!head_match || !remote_match) {
/* This differs from "-m" in that we'll silently ignore unmerged entries */
if (!strcmp(arg, "--reset")) {
if (stage || merge)
/* This differs from "-m" in that we'll silently ignore unmerged entries */
if (!strcmp(arg, "--reset")) {
if (stage || merge)
if (get_sha1(arg, sha1) < 0)
usage(read_tree_usage);
if (list_tree(sha1) < 0)
die("failed to unpack tree object %s", arg);
stage++;
}
if (get_sha1(arg, sha1) < 0)
usage(read_tree_usage);
if (list_tree(sha1) < 0)
die("failed to unpack tree object %s", arg);
stage++;
}