Skip to content

Commit df351c6

Browse files
peffgitster
authored andcommitted
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>
1 parent 6642969 commit df351c6

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

unpack-trees.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1758,7 +1758,6 @@ static void invalidate_ce_path(const struct cache_entry *ce,
17581758
*/
17591759
static int verify_clean_submodule(const char *old_sha1,
17601760
const struct cache_entry *ce,
1761-
enum unpack_trees_error_types error_type,
17621761
struct unpack_trees_options *o)
17631762
{
17641763
if (!submodule_from_ce(ce))
@@ -1769,7 +1768,6 @@ static int verify_clean_submodule(const char *old_sha1,
17691768
}
17701769

17711770
static int verify_clean_subdirectory(const struct cache_entry *ce,
1772-
enum unpack_trees_error_types error_type,
17731771
struct unpack_trees_options *o)
17741772
{
17751773
/*
@@ -1792,7 +1790,7 @@ static int verify_clean_subdirectory(const struct cache_entry *ce,
17921790
if (!sub_head && oideq(&oid, &ce->oid))
17931791
return 0;
17941792
return verify_clean_submodule(sub_head ? NULL : oid_to_hex(&oid),
1795-
ce, error_type, o);
1793+
ce, o);
17961794
}
17971795

17981796
/*
@@ -1888,7 +1886,7 @@ static int check_ok_to_remove(const char *name, int len, int dtype,
18881886
* files that are in "foo/" we would lose
18891887
* them.
18901888
*/
1891-
if (verify_clean_subdirectory(ce, error_type, o) < 0)
1889+
if (verify_clean_subdirectory(ce, o) < 0)
18921890
return -1;
18931891
return 0;
18941892
}

0 commit comments

Comments
 (0)