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>

Jeff King committed Mar 20, 2019 at 04:15 UTC df351c6e676e8eea0defa00ea919ad7da6bd03f1
1 file changed +2 -4
unpack-trees.c
+2 -4
@@ -1758,7 +1758,6 @@ static void invalidate_ce_path(const struct cache_entry *ce,
1758 */
1759 static int verify_clean_submodule(const char *old_sha1,
1760 const struct cache_entry *ce,
1761 - enum unpack_trees_error_types error_type,
1761 struct unpack_trees_options *o)
1762 {
1763 if (!submodule_from_ce(ce))
@@ -1769,7 +1768,6 @@ static int verify_clean_submodule(const char *old_sha1,
1768 }
1769
1770 static int verify_clean_subdirectory(const struct cache_entry *ce,
1772 - enum unpack_trees_error_types error_type,
1771 struct unpack_trees_options *o)
1772 {
1773 /*
@@ -1792,7 +1790,7 @@ static int verify_clean_subdirectory(const struct cache_entry *ce,
1790 if (!sub_head && oideq(&oid, &ce->oid))
1791 return 0;
1792 return verify_clean_submodule(sub_head ? NULL : oid_to_hex(&oid),
1795 - ce, error_type, o);
1793 + ce, o);
1794 }
1795
1796 /*
@@ -1888,7 +1886,7 @@ static int check_ok_to_remove(const char *name, int len, int dtype,
1886 * files that are in "foo/" we would lose
1887 * them.
1888 */
1891 - if (verify_clean_subdirectory(ce, error_type, o) < 0)
1889 + if (verify_clean_subdirectory(ce, o) < 0)
1890 return -1;
1891 return 0;
1892 }