unpack-trees: drop unused error_type parameters

The verify_clean_subdirectory() helper takes an error_type parameter
from the caller, but doesn't actually use it. Instead, when it calls
add_rejected_path() it passes NOT_UPTODATE_DIR, its own custom error
type which is more specific than what the caller provides. Likewise for
verify_clean_submodule(), which always passes WOULD_LOSE_SUBMODULE.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Jeff King 2019-03-20 04:15:27 -04:00 committed by Junio C Hamano
parent 664296985c
commit df351c6e67

View File

@ -1758,7 +1758,6 @@ static void invalidate_ce_path(const struct cache_entry *ce,
*/
static int verify_clean_submodule(const char *old_sha1,
const struct cache_entry *ce,
enum unpack_trees_error_types error_type,
struct unpack_trees_options *o)
{
if (!submodule_from_ce(ce))
@ -1769,7 +1768,6 @@ static int verify_clean_submodule(const char *old_sha1,
}
static int verify_clean_subdirectory(const struct cache_entry *ce,
enum unpack_trees_error_types error_type,
struct unpack_trees_options *o)
{
/*
@ -1792,7 +1790,7 @@ static int verify_clean_subdirectory(const struct cache_entry *ce,
if (!sub_head && oideq(&oid, &ce->oid))
return 0;
return verify_clean_submodule(sub_head ? NULL : oid_to_hex(&oid),
ce, error_type, o);
ce, o);
}
/*
@ -1888,7 +1886,7 @@ static int check_ok_to_remove(const char *name, int len, int dtype,
* files that are in "foo/" we would lose
* them.
*/
if (verify_clean_subdirectory(ce, error_type, o) < 0)
if (verify_clean_subdirectory(ce, o) < 0)
return -1;
return 0;
}