apply: move verify_index_match() higher
We will be adding another caller of this function in a later patch. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano committed
Jun 12, 2012 at 21:16 UTC
e09837e25d50cba97ffcc2934801dbd861e4276d
1 file changed
+10
-10
builtin/apply.c
+10
-10
@@ -3074,6 +3074,16 @@ static struct patch *previous_patch(struct patch *patch, int *gone)
3074
return previous;
3075
}
3076
3077
+static int verify_index_match(struct cache_entry *ce, struct stat *st)
3078
+{
3079
+ if (S_ISGITLINK(ce->ce_mode)) {
3080
+ if (!S_ISDIR(st->st_mode))
3081
+ return -1;
3082
+ return 0;
3083
+ }
3084
+ return ce_match_stat(ce, st, CE_MATCH_IGNORE_VALID|CE_MATCH_IGNORE_SKIP_WORKTREE);
3085
+}
3086
+
3087
#define SUBMODULE_PATCH_WITHOUT_INDEX 1
3088
3089
static int load_patch_target(struct strbuf *buf,
@@ -3260,16 +3270,6 @@ static int apply_data(struct patch *patch, struct stat *st, struct cache_entry *
3270
return 0;
3271
}
3272
3263
-static int verify_index_match(struct cache_entry *ce, struct stat *st)
3264
-{
3265
- if (S_ISGITLINK(ce->ce_mode)) {
3266
- if (!S_ISDIR(st->st_mode))
3267
- return -1;
3268
- return 0;
3269
- }
3270
- return ce_match_stat(ce, st, CE_MATCH_IGNORE_VALID|CE_MATCH_IGNORE_SKIP_WORKTREE);
3271
-}
3272
-
3273
/*
3274
* If "patch" that we are looking at modifies or deletes what we have,
3275
* we would want it not to lose any local modification we have, either