static int walk_tree_file(const char *root, const git_tree_entry *entry, git_repository *repo) { struct dive *dive = active_dive; dive_trip_t *trip = active_trip; const char *name = git_tree_entry_name(entry); switch (*name) { /* Picture file? They are saved as time offsets in the dive */ case '-': case '+': if (dive) return parse_picture_entry(repo, entry, name); break; case 'D': if (dive && !strncmp(name, "Divecomputer", 12)) return parse_divecomputer_entry(repo, entry, name+12); if (dive && !strncmp(name, "Dive", 4)) return parse_dive_entry(repo, entry, name+4); break; case '0': if (trip && !strcmp(name, "00-Trip")) return parse_trip_entry(repo, entry); if (!strcmp(name, "00-Subsurface")) return parse_settings_entry(repo, entry); break; } report_error("Unknown file %s%s (%p %p)", root, name, dive, trip); return GIT_WALK_SKIP; }
static int walk_tree_file(const char *root, const git_tree_entry *entry, git_repository *repo) { struct dive *dive = active_dive; dive_trip_t *trip = active_trip; const char *name = git_tree_entry_name(entry); if (dive && !strncmp(name, "Divecomputer", 12)) return parse_divecomputer_entry(repo, entry, name+12); if (dive && !strncmp(name, "Dive", 4)) return parse_dive_entry(repo, entry, name+4); if (trip && !strcmp(name, "00-Trip")) return parse_trip_entry(repo, entry); if (!strcmp(name, "00-Subsurface")) return parse_settings_entry(repo, entry); report_error("Unknown file %s%s (%p %p)", root, name, dive, trip); return GIT_WALK_SKIP; }