FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

merge: Check file mode when resolving renames by ccstolley · Pull Request #6060 · libgit2/libgit2 · GitHub

merge: Check file mode when resolving renames - #6060

Merged
ethomson merged 2 commits into
libgit2:mainfrom
ccstolley:ccs_merge_bugfix
Sep 20, 2021
Merged

ethomson merged 2 commits into
libgit2:mainfrom
ccstolley:ccs_merge_bugfix

Conversation

Copy link
Copy Markdown
Contributor

When determining if ours or theirs changed, we check the oids but not
their respective file modes. This can lead to merges introducing incorrect
file mode changes (eg., in a revert). A simple linear example might be:

commit A - introduces file foo with chmod 0755
commit B - updates some unrelated file
commit C - renames foo to bar and chmod 0644

If B is reverted, bar will unexpectedly acquire mode 0755. This is
reproduced in the revert/rename.c test below.

Colin Stolley added 2 commits September 15, 2021 17:09
When determining if ours or theirs changed, we check the oids but not
their respective file modes. This can lead to merges introducing incorrect
file mode changes (eg., in a revert). A simple linear example might be:

commit A - introduces file `foo` with chmod 0755
commit B - updates some unrelated file
commit C - renames `foo` to `bar` and chmod 0644

If B is reverted, `bar` will unexpectedly acquire mode 0755.

Copy link
Copy Markdown
Member

Thanks for the fix!

ethomson merged commit 4f5653a into libgit2:main Sep 20, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL