Code

Quiet make: do not leave Windows behind
[git.git] / unpack-trees.c
index 6847c2d966c5e1d0299b21682d6fef2637329071..aaacaf1015ccf1f353151982a3018ad349663d76 100644 (file)
@@ -61,7 +61,7 @@ static void unlink_entry(struct cache_entry *ce)
 {
        if (has_symlink_or_noent_leading_path(ce->name, ce_namelen(ce)))
                return;
-       if (unlink(ce->name))
+       if (unlink_or_warn(ce->name))
                return;
        schedule_dir_for_removal(ce->name, ce_namelen(ce));
 }
@@ -87,7 +87,8 @@ static int check_updates(struct unpack_trees_options *o)
                cnt = 0;
        }
 
-       git_attr_set_direction(GIT_ATTR_CHECKOUT, &o->result);
+       if (o->update)
+               git_attr_set_direction(GIT_ATTR_CHECKOUT, &o->result);
        for (i = 0; i < index->cache_nr; i++) {
                struct cache_entry *ce = index->cache[i];
 
@@ -112,7 +113,8 @@ static int check_updates(struct unpack_trees_options *o)
                }
        }
        stop_progress(&progress);
-       git_attr_set_direction(GIT_ATTR_CHECKIN, NULL);
+       if (o->update)
+               git_attr_set_direction(GIT_ATTR_CHECKIN, NULL);
        return errs != 0;
 }