{"thread":{"id":"49120","subject":"[PATCH 0/1] Fix a recently-introduced compile warning","startedAt":"2018-08-14T11:02:24Z","lastAt":"2018-08-14T15:08:44Z","messageCount":3,"participants":["Johannes Schindelin via GitGitGadget","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":1},"messages":[{"id":"355525","messageId":"pull.18.git.gitgitgadget@gmail.com","threadId":"49120","inReplyTo":null,"subject":"[PATCH 0/1] Fix a recently-introduced compile warning","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2018-08-14T11:02:20Z","receivedAt":"2018-08-14T11:02:24Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"With the relatively frequent breakages of pu recently, I had trouble staying\non top of the compile errors/test failures, sorry.\n\nThis one exists since Sunday, and it is a compile error only with \nDEVELOPER=1, which is, however, the recommended way to build in Git for\nWindows' SDK.\n\nNote: it is based on nd/clone-case-smashing-warning.\n\nJohannes Schindelin (1):\n  mark_colliding_entries(): fix incorrect #if...#endif guard\n\n entry.c | 6 +++---\n 1 file changed, 3 insertions(+), 3 deletions(-)\n\n\nbase-commit: f80218bf4e65ccc06cc9173c0ac5a5520d380f36\nPublished-As: https://github.com/gitgitgadget/git/releases/tags/pr-18%2Fdscho%2Fclone-case-smashing-warning-v1\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-18/dscho/clone-case-smashing-warning-v1\nPull-Request: https://github.com/gitgitgadget/git/pull/18\n-- \ngitgitgadget\n"},{"id":"355526","messageId":"becaf4374a1f8e56a4a26203d74ba64560a465da.1534244538.git.gitgitgadget@gmail.com","threadId":"49120","inReplyTo":"pull.18.git.gitgitgadget@gmail.com","subject":"[PATCH 1/1] mark_colliding_entries(): fix incorrect #if...#endif guard","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2018-08-14T11:02:21Z","receivedAt":"2018-08-14T11:02:24Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"From: Johannes Schindelin <johannes.schindelin@gmx.de>\n\nThe way the guard was put, the code was declaring an unused variable on\nWindows. No need to do that, so let's fix it.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n entry.c | 6 +++---\n 1 file changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/entry.c b/entry.c\nindex c70340df8..2bce13352 100644\n--- a/entry.c\n+++ b/entry.c\n@@ -402,11 +402,9 @@ static int check_path(const char *path, int len, struct stat *st, int skiplen)\n static void mark_colliding_entries(const struct checkout *state,\n \t\t\t\t   struct cache_entry *ce, struct stat *st)\n {\n+#if !defined(GIT_WINDOWS_NATIVE) /* inode is always zero on Windows */\n \tint i;\n \n-\tce->ce_flags |= CE_MATCHED;\n-\n-#if !defined(GIT_WINDOWS_NATIVE) /* inode is always zero on Windows */\n \tfor (i = 0; i < state->istate->cache_nr; i++) {\n \t\tstruct cache_entry *dup = state->istate->cache[i];\n \n@@ -422,6 +420,8 @@ static void mark_colliding_entries(const struct checkout *state,\n \t\t}\n \t}\n #endif\n+\n+\tce->ce_flags |= CE_MATCHED;\n }\n \n /*\n-- \ngitgitgadget\n"},{"id":"355552","messageId":"xmqqva8d0yvd.fsf@gitster-ct.c.googlers.com","threadId":"49120","inReplyTo":"becaf4374a1f8e56a4a26203d74ba64560a465da.1534244538.git.gitgitgadget@gmail.com","subject":"Re: [PATCH 1/1] mark_colliding_entries(): fix incorrect #if...#endif guard","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-08-14T15:08:38Z","receivedAt":"2018-08-14T15:08:44Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Johannes Schindelin via GitGitGadget\" <gitgitgadget@gmail.com>\nwrites:\n\n> From: Johannes Schindelin <johannes.schindelin@gmx.de>\n>\n> The way the guard was put, the code was declaring an unused variable on\n> Windows. No need to do that, so let's fix it.\n>\n> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> ---\n>  entry.c | 6 +++---\n>  1 file changed, 3 insertions(+), 3 deletions(-)\n>\n> diff --git a/entry.c b/entry.c\n> index c70340df8..2bce13352 100644\n> --- a/entry.c\n> +++ b/entry.c\n> @@ -402,11 +402,9 @@ static int check_path(const char *path, int len, struct stat *st, int skiplen)\n>  static void mark_colliding_entries(const struct checkout *state,\n>  \t\t\t\t   struct cache_entry *ce, struct stat *st)\n>  {\n> +#if !defined(GIT_WINDOWS_NATIVE) /* inode is always zero on Windows */\n>  \tint i;\n>  \n> -\tce->ce_flags |= CE_MATCHED;\n> -\n> -#if !defined(GIT_WINDOWS_NATIVE) /* inode is always zero on Windows */\n>  \tfor (i = 0; i < state->istate->cache_nr; i++) {\n>  \t\tstruct cache_entry *dup = state->istate->cache[i];\n>  \n> @@ -422,6 +420,8 @@ static void mark_colliding_entries(const struct checkout *state,\n>  \t\t}\n>  \t}\n>  #endif\n> +\n> +\tce->ce_flags |= CE_MATCHED;\n>  }\n\nEven though it looks a bit odd to smudge 'ce' itself after the loop,\nI think this would not break anything, simply because the loop does\ntreat the 'ce' as special and stops the iteration once it sees it,\neven before its MATCHED bit is set.\n\nDuy, if you are going to send a new version updated for other\nreasons, please squash this in.  In the meantime, I'll queue it on\ntop of what we have right now.\n\nThanks, both.\n\n"}]}