get_remote_group(): use skip_prefix()
authorMichael Haggerty <mhagger@alum.mit.edu>
Tue, 28 Jul 2015 21:08:21 +0000 (23:08 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 28 Jul 2015 21:39:26 +0000 (14:39 -0700)
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/fetch.c
index bbc2bb885966cad4fead45d266d8db2bff1332b3..262809c78725a2a7924f1f806f40bf1a7577df11 100644 (file)
@@ -973,8 +973,7 @@ static int get_remote_group(const char *key, const char *value, void *priv)
 {
        struct remote_group_data *g = priv;
 
-       if (starts_with(key, "remotes.") &&
-                       !strcmp(key + 8, g->name)) {
+       if (skip_prefix(key, "remotes.", &key) && !strcmp(key, g->name)) {
                /* split list by white space */
                while (*value) {
                        size_t wordlen = strcspn(value, " \t\n");