{"thread":{"id":"63094","subject":"[PATCH] dir.h: remove duplicate forward declaration of struct repository","startedAt":"2025-03-11T14:59:38Z","lastAt":"2025-03-11T22:13:06Z","messageCount":2,"participants":["Abhijeetsingh Meena via GitGitGadget","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"513982","messageId":"pull.1879.git.1741705175922.gitgitgadget@gmail.com","threadId":"63094","inReplyTo":null,"subject":"[PATCH] dir.h: remove duplicate forward declaration of struct repository","fromName":"Abhijeetsingh Meena via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2025-03-11T14:59:35Z","receivedAt":"2025-03-11T14:59:38Z","isPatch":true,"sender":{"key":"abhijeetsingh.github@gmail.com","avatar":null},"body":"From: Abhijeetsingh Meena <abhijeet040403@gmail.com>\n\nThe `struct repository;` forward declaration appears twice in `dir.h`:\nonce at line 10 and again at line 46. This duplication is unnecessary\nand likely unintentional.\n\nRemoving the second declaration has no impact on compilation, as verified\nby a clean build.\n\nSigned-off-by: Abhijeetsingh Meena <abhijeet040403@gmail.com>\n---\n    Remove duplicate forward declaration of struct repository\n    \n    \n    Summary\n    =======\n    \n    While exploring how Git searches for .gitignore files and manages\n    ignored files, I came across dir.h. While reading through the file, I\n    noticed that struct repository; was forward-declared twice. This\n    duplication appears unnecessary, and removing the second declaration\n    compiles cleanly.\n\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-1879%2FEthan0456%2Fcleanup%2Fdeduplicate-repo-fwd-decl-v1\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1879/Ethan0456/cleanup/deduplicate-repo-fwd-decl-v1\nPull-Request: https://github.com/gitgitgadget/git/pull/1879\n\n dir.h | 1 -\n 1 file changed, 1 deletion(-)\n\ndiff --git a/dir.h b/dir.h\nindex a3a2f00f5d9..e659c47ad77 100644\n--- a/dir.h\n+++ b/dir.h\n@@ -43,7 +43,6 @@ struct repository;\n  *\n  */\n \n-struct repository;\n \n struct dir_entry {\n \tunsigned int len;\n\nbase-commit: ef8ce8f3d4344fd3af049c17eeba5cd20d98b69f\n-- \ngitgitgadget\n"},{"id":"514009","messageId":"xmqqecz32p3j.fsf@gitster.g","threadId":"63094","inReplyTo":"pull.1879.git.1741705175922.gitgitgadget@gmail.com","subject":"Re: [PATCH] dir.h: remove duplicate forward declaration of struct repository","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2025-03-11T22:13:04Z","receivedAt":"2025-03-11T22:13:06Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Abhijeetsingh Meena via GitGitGadget\" <gitgitgadget@gmail.com>\nwrites:\n\n> From: Abhijeetsingh Meena <abhijeet040403@gmail.com>\n>\n> The `struct repository;` forward declaration appears twice in `dir.h`:\n> once at line 10 and again at line 46. This duplication is unnecessary\n> and likely unintentional.\n>\n> Removing the second declaration has no impact on compilation, as verified\n> by a clean build.\n>\n> Signed-off-by: Abhijeetsingh Meena <abhijeet040403@gmail.com>\n> ---\n\nThanks.  Will apply.\n\n>  dir.h | 1 -\n>  1 file changed, 1 deletion(-)\n>\n> diff --git a/dir.h b/dir.h\n> index a3a2f00f5d9..e659c47ad77 100644\n> --- a/dir.h\n> +++ b/dir.h\n> @@ -43,7 +43,6 @@ struct repository;\n>   *\n>   */\n>  \n> -struct repository;\n>  \n>  struct dir_entry {\n>  \tunsigned int len;\n>\n> base-commit: ef8ce8f3d4344fd3af049c17eeba5cd20d98b69f\n"}]}