{"thread":{"id":"26579","subject":"[PATCH 1/2] checkout: add missing const to describe_detached_head","startedAt":"2011-02-22T22:43:21Z","lastAt":"2011-02-22T22:43:23Z","messageCount":3,"participants":["Ævar Arnfjörð Bjarmason"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"161918","messageId":"1298414603-22338-1-git-send-email-avarab@gmail.com","threadId":"26579","inReplyTo":null,"subject":"[PATCH 0/2] Add missing const to char* declarations","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-22T22:43:21Z","receivedAt":"2011-02-22T22:43:21Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"These two patches by Jonathan Nieder have been extracted from my\nsoon-to-be-sent updated gettext series, which he's graciously helped\nwith.\n\nWithout these changes this code using the new _() function will warn\nbecause it's expecting char* but it's returning const char*. Since\nthere's no reason for these not to be const just add a const to the\ndeclaration.\n\nJonathan Nieder (2):\n  checkout: add missing const to describe_detached_head\n  update-index --refresh --porcelain: add missing const\n\n builtin/checkout.c |    2 +-\n cache.h            |    2 +-\n read-cache.c       |    4 ++--\n 3 files changed, 4 insertions(+), 4 deletions(-)\n\n-- \n1.7.2.3\n"},{"id":"161917","messageId":"1298414603-22338-2-git-send-email-avarab@gmail.com","threadId":"26579","inReplyTo":"1298414603-22338-1-git-send-email-avarab@gmail.com","subject":"[PATCH 1/2] checkout: add missing const to describe_detached_head","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-22T22:43:22Z","receivedAt":"2011-02-22T22:43:22Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"From: Jonathan Nieder <jrnieder@gmail.com>\n\nSigned-off-by: Jonathan Nieder <jrnieder@gmail.com>\n---\n builtin/checkout.c |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/builtin/checkout.c b/builtin/checkout.c\nindex cd7f56e..bef324e 100644\n--- a/builtin/checkout.c\n+++ b/builtin/checkout.c\n@@ -297,7 +297,7 @@ static void show_local_changes(struct object *head, struct diff_options *opts)\n \trun_diff_index(&rev, 0);\n }\n \n-static void describe_detached_head(char *msg, struct commit *commit)\n+static void describe_detached_head(const char *msg, struct commit *commit)\n {\n \tstruct strbuf sb = STRBUF_INIT;\n \tstruct pretty_print_context ctx = {0};\n-- \n1.7.2.3\n"},{"id":"161919","messageId":"1298414603-22338-3-git-send-email-avarab@gmail.com","threadId":"26579","inReplyTo":"1298414603-22338-1-git-send-email-avarab@gmail.com","subject":"[PATCH 2/2] update-index --refresh --porcelain: add missing const","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2011-02-22T22:43:23Z","receivedAt":"2011-02-22T22:43:23Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"From: Jonathan Nieder <jrnieder@gmail.com>\n\nSigned-off-by: Jonathan Nieder <jrnieder@gmail.com>\n---\n cache.h      |    2 +-\n read-cache.c |    4 ++--\n 2 files changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/cache.h b/cache.h\nindex 3abf895..4a758ba 100644\n--- a/cache.h\n+++ b/cache.h\n@@ -511,7 +511,7 @@ extern void fill_stat_cache_info(struct cache_entry *ce, struct stat *st);\n #define REFRESH_IGNORE_MISSING\t0x0008\t/* ignore non-existent */\n #define REFRESH_IGNORE_SUBMODULES\t0x0010\t/* ignore submodules */\n #define REFRESH_IN_PORCELAIN\t0x0020\t/* user friendly output, not \"needs update\" */\n-extern int refresh_index(struct index_state *, unsigned int flags, const char **pathspec, char *seen, char *header_msg);\n+extern int refresh_index(struct index_state *, unsigned int flags, const char **pathspec, char *seen, const char *header_msg);\n \n struct lock_file {\n \tstruct lock_file *next;\ndiff --git a/read-cache.c b/read-cache.c\nindex 4f2e890..15b0a73 100644\n--- a/read-cache.c\n+++ b/read-cache.c\n@@ -1104,7 +1104,7 @@ static struct cache_entry *refresh_cache_ent(struct index_state *istate,\n }\n \n static void show_file(const char * fmt, const char * name, int in_porcelain,\n-\t\t      int * first, char *header_msg)\n+\t\t      int * first, const char *header_msg)\n {\n \tif (in_porcelain && *first && header_msg) {\n \t\tprintf(\"%s\\n\", header_msg);\n@@ -1114,7 +1114,7 @@ static void show_file(const char * fmt, const char * name, int in_porcelain,\n }\n \n int refresh_index(struct index_state *istate, unsigned int flags, const char **pathspec,\n-\t\t  char *seen, char *header_msg)\n+\t\t  char *seen, const char *header_msg)\n {\n \tint i;\n \tint has_errors = 0;\n-- \n1.7.2.3\n"}]}