static void progress_cb(const char *str, int len, void *data)
{
- data = data;
+ (void)data;
printf("remote: %.*s", len, str);
fflush(stdout); /* We don't have the \n to force the flush */
}
static int update_cb(const char *refname, const git_oid *a, const git_oid *b, void *data)
{
char a_str[GIT_OID_HEXSZ+1], b_str[GIT_OID_HEXSZ+1];
- data = data;
+ (void)data;
git_oid_fmt(b_str, b);
b_str[GIT_OID_HEXSZ] = '\0';
pthread_t worker;
#endif
- argc = argc;
+ if (argc < 2) {
+ fprintf(stderr, "usage: %s fetch <repo>\n", argv[-1]);
+ return EXIT_FAILURE;
+ }
+
// Figure out whether it's a named remote or a URL
printf("Fetching %s for repo %p\n", argv[1], repo);
if (git_remote_load(&remote, repo, argv[1]) < 0) {
// the indexing to finish in a worker thread
static int index_cb(const git_transfer_progress *stats, void *data)
{
- data = data;
+ (void)data;
printf("\rProcessing %d of %d", stats->indexed_objects, stats->total_objects);
return 0;
ssize_t read_bytes;
char buf[512];
- repo = repo;
+ (void)repo;
+
if (argc < 2) {
- fprintf(stderr, "I need a packfile\n");
+ fprintf(stderr, "usage: %s index-pack <packfile>\n", argv[-1]);
return EXIT_FAILURE;
}
{
char oid[GIT_OID_HEXSZ + 1] = {0};
- payload = payload;
+ (void)payload;
git_oid_fmt(oid, &head->oid);
printf("%s\t%s\n", oid, head->name);
return 0;
{
int error;
- argc = argc;
+ if (argc < 2) {
+ fprintf(stderr, "usage: %s ls-remote <remote>\n", argv[-1]);
+ return EXIT_FAILURE;
+ }
+
/* If there's a ':' in the name, assume it's an URL */
if (strchr(argv[1], ':') != NULL) {
error = use_unnamed(repo, argv[1]);
const char *end = date;
int i;
- while (isalpha(*++end));
- ;
+ while (isalpha(*++end))
+ /* scan to non-alpha */;
for (i = 0; i < 12; i++) {
size_t match = match_string(date, month_names[i]);