#include "cache.h"
#include "parse-options.h"
#include "transport.h"
#include "remote.h"
#include "string-list.h"
#include "strbuf.h"
#include "run-command.h"
#include "refs.h"
static const char * const builtin_remote_usage[] = {
"git remote [-v | --verbose]",
"git remote add [-t <branch>] [-m <master>] [-f] [--mirror] <name> <url>",
"git remote rename <old> <new>",
"git remote rm <name>",
"git remote set-head <name> (-a | -d | <branch>)",
"git remote [-v | --verbose] show [-n] <name>",
"git remote prune [-n | --dry-run] <name>",
"git remote [-v | --verbose] update [-p | --prune] [group | remote]",
"git remote set-url <name> <newurl> [<oldurl>]",
"git remote set-url --add <name> <newurl>",
"git remote set-url --delete <name> <url>",
NULL
};
static const char * const builtin_remote_add_usage[] = {
"git remote add [<options>] <name> <url>",
NULL
};
static const char * const builtin_remote_rename_usage[] = {
"git remote rename <old> <new>",
NULL
};
static const char * const builtin_remote_rm_usage[] = {
"git remote rm <name>",
NULL
};
static const char * const builtin_remote_sethead_usage[] = {
"git remote set-head <name> (-a | -d | <branch>])",
NULL
};
static const char * const builtin_remote_show_usage[] = {
"git remote show [<options>] <name>",
NULL
};
static const char * const builtin_remote_prune_usage[] = {
"git remote prune [<options>] <name>",
NULL
};
static const char * const builtin_remote_update_usage[] = {
"git remote update [<options>] [<group> | <remote>]...",
NULL
};
static const char * const builtin_remote_seturl_usage[] = {
"git remote set-url [--push] <name> <newurl> [<oldurl>]",
"git remote set-url --add <name> <newurl>",
"git remote set-url --delete <name> <url>",
NULL
};
#define GET_REF_STATES (1<<0)
#define GET_HEAD_NAMES (1<<1)
#define GET_PUSH_REF_STATES (1<<2)
static int verbose;
static int show_all(void);
static int prune_remote(const char *remote, int dry_run);
static inline int postfixcmp(const char *string, const char *postfix)
{
int len1 = strlen(string), len2 = strlen(postfix);
|