Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2019-09-09 22:26:40 +0300
committerJunio C Hamano <gitster@pobox.com>2019-09-09 22:26:40 +0300
commitc8ada15456f951913dbf628a7c441032e90b8e11 (patch)
tree60e0e012e23b909c6938b2f164b1c8f92bed518a /apply.c
parent8f3ba423e7149fdbe1d7e1d2f245b4c0a2a1bdfb (diff)
parent2c65d90f7579a0e2a6460eebce44795587e87043 (diff)
Merge branch 'bc/reread-attributes-during-rebase'
The "git am" based backend of "git rebase" ignored the result of updating ".gitattributes" done in one step when replaying subsequent steps. * bc/reread-attributes-during-rebase: am: reload .gitattributes after patching it path: add a function to check for path suffix
Diffstat (limited to 'apply.c')
-rw-r--r--apply.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/apply.c b/apply.c
index cde95369bb..57a61f2881 100644
--- a/apply.c
+++ b/apply.c
@@ -4643,6 +4643,7 @@ static int apply_patch(struct apply_state *state,
struct patch *list = NULL, **listp = &list;
int skipped_patch = 0;
int res = 0;
+ int flush_attributes = 0;
state->patch_input_file = filename;
if (read_patch_file(&buf, fd) < 0)
@@ -4670,6 +4671,14 @@ static int apply_patch(struct apply_state *state,
patch_stats(state, patch);
*listp = patch;
listp = &patch->next;
+
+ if ((patch->new_name &&
+ ends_with_path_components(patch->new_name,
+ GITATTRIBUTES_FILE)) ||
+ (patch->old_name &&
+ ends_with_path_components(patch->old_name,
+ GITATTRIBUTES_FILE)))
+ flush_attributes = 1;
}
else {
if (state->apply_verbosity > verbosity_normal)
@@ -4746,6 +4755,8 @@ static int apply_patch(struct apply_state *state,
if (state->summary && state->apply_verbosity > verbosity_silent)
summary_patch_list(list);
+ if (flush_attributes)
+ reset_parsed_attributes();
end:
free_patch_list(list);
strbuf_release(&buf);