git-check-attr: Error out if no pathnames are specified
[gitweb.git] / unpack-trees.c
index 07f83642443601d107e0a2425407b3250c022dcd..3a61d821ee85a9cfb026909c6ae90def360a7681 100644 (file)
@@ -593,7 +593,7 @@ static int unpack_nondirectories(int n, unsigned long mask,
 static int unpack_failed(struct unpack_trees_options *o, const char *message)
 {
        discard_index(&o->result);
-       if (!o->gently) {
+       if (!o->gently && !o->exiting_early) {
                if (message)
                        return error("%s", message);
                return -1;
@@ -1133,6 +1133,8 @@ int unpack_trees(unsigned len, struct tree_desc *t, struct unpack_trees_options
                display_error_msgs(o);
        mark_all_ce_unused(o->src_index);
        ret = unpack_failed(o, NULL);
+       if (o->exiting_early)
+               ret = 0;
        goto done;
 }