aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--commit.h1
-rw-r--r--http.c64
-rw-r--r--http.h2
-rw-r--r--line-log.c2
-rw-r--r--line-log.h2
-rw-r--r--pack-bitmap.c28
-rw-r--r--pack-bitmap.h1
-rw-r--r--prompt.c5
-rw-r--r--prompt.h1
-rw-r--r--remote.c2
-rw-r--r--remote.h1
-rw-r--r--revision.c106
-rw-r--r--revision.h12
-rw-r--r--shallow.c2
-rw-r--r--urlmatch.c6
-rw-r--r--urlmatch.h1
16 files changed, 111 insertions, 125 deletions
diff --git a/commit.h b/commit.h
index 5cc1e7ec9..9f189cb05 100644
--- a/commit.h
+++ b/commit.h
@@ -254,7 +254,6 @@ extern int for_each_commit_graft(each_commit_graft_fn, void *);
extern int is_repository_shallow(void);
extern struct commit_list *get_shallow_commits(struct object_array *heads,
int depth, int shallow_flag, int not_shallow_flag);
-extern void check_shallow_file_for_update(void);
extern void set_alternate_shallow_file(const char *path, int override);
extern int write_shallow_commits(struct strbuf *out, int use_pack_protocol,
const struct sha1_array *extra);
diff --git a/http.c b/http.c
index 44b130c54..4ecf9e8f7 100644
--- a/http.c
+++ b/http.c
@@ -117,6 +117,37 @@ size_t fwrite_null(char *ptr, size_t eltsize, size_t nmemb, void *strbuf)
return eltsize * nmemb;
}
+static void closedown_active_slot(struct active_request_slot *slot)
+{
+ active_requests--;
+ slot->in_use = 0;
+}
+
+static void finish_active_slot(struct active_request_slot *slot)
+{
+ closedown_active_slot(slot);
+ curl_easy_getinfo(slot->curl, CURLINFO_HTTP_CODE, &slot->http_code);
+
+ if (slot->finished != NULL)
+ (*slot->finished) = 1;
+
+ /* Store slot results so they can be read after the slot is reused */
+ if (slot->results != NULL) {
+ slot->results->curl_result = slot->curl_result;
+ slot->results->http_code = slot->http_code;
+#if LIBCURL_VERSION_NUM >= 0x070a08
+ curl_easy_getinfo(slot->curl, CURLINFO_HTTPAUTH_AVAIL,
+ &slot->results->auth_avail);
+#else
+ slot->results->auth_avail = 0;
+#endif
+ }
+
+ /* Run callback if appropriate */
+ if (slot->callback_func != NULL)
+ slot->callback_func(slot->callback_data);
+}
+
#ifdef USE_CURL_MULTI
static void process_curl_messages(void)
{
@@ -736,12 +767,6 @@ void run_active_slot(struct active_request_slot *slot)
#endif
}
-static void closedown_active_slot(struct active_request_slot *slot)
-{
- active_requests--;
- slot->in_use = 0;
-}
-
static void release_active_slot(struct active_request_slot *slot)
{
closedown_active_slot(slot);
@@ -758,31 +783,6 @@ static void release_active_slot(struct active_request_slot *slot)
#endif
}
-void finish_active_slot(struct active_request_slot *slot)
-{
- closedown_active_slot(slot);
- curl_easy_getinfo(slot->curl, CURLINFO_HTTP_CODE, &slot->http_code);
-
- if (slot->finished != NULL)
- (*slot->finished) = 1;
-
- /* Store slot results so they can be read after the slot is reused */
- if (slot->results != NULL) {
- slot->results->curl_result = slot->curl_result;
- slot->results->http_code = slot->http_code;
-#if LIBCURL_VERSION_NUM >= 0x070a08
- curl_easy_getinfo(slot->curl, CURLINFO_HTTPAUTH_AVAIL,
- &slot->results->auth_avail);
-#else
- slot->results->auth_avail = 0;
-#endif
- }
-
- /* Run callback if appropriate */
- if (slot->callback_func != NULL)
- slot->callback_func(slot->callback_data);
-}
-
void finish_all_active_slots(void)
{
struct active_request_slot *slot = active_queue_head;
@@ -845,7 +845,7 @@ char *get_remote_object_url(const char *url, const char *hex,
return strbuf_detach(&buf, NULL);
}
-int handle_curl_result(struct slot_results *results)
+static int handle_curl_result(struct slot_results *results)
{
/*
* If we see a failing http code with CURLE_OK, we have turned off
diff --git a/http.h b/http.h
index 473179b14..49afe3927 100644
--- a/http.h
+++ b/http.h
@@ -85,9 +85,7 @@ extern curlioerr ioctl_buffer(CURL *handle, int cmd, void *clientp);
extern struct active_request_slot *get_active_slot(void);
extern int start_active_slot(struct active_request_slot *slot);
extern void run_active_slot(struct active_request_slot *slot);
-extern void finish_active_slot(struct active_request_slot *slot);
extern void finish_all_active_slots(void);
-extern int handle_curl_result(struct slot_results *results);
/*
* This will run one slot to completion in a blocking manner, similar to how
diff --git a/line-log.c b/line-log.c
index b7864ad58..a490efea0 100644
--- a/line-log.c
+++ b/line-log.c
@@ -237,7 +237,7 @@ static void diff_ranges_release(struct diff_ranges *diff)
range_set_release(&diff->target);
}
-void line_log_data_init(struct line_log_data *r)
+static void line_log_data_init(struct line_log_data *r)
{
memset(r, 0, sizeof(struct line_log_data));
range_set_init(&r->ranges, 0);
diff --git a/line-log.h b/line-log.h
index a9212d84e..7a5c24e2d 100644
--- a/line-log.h
+++ b/line-log.h
@@ -54,8 +54,6 @@ struct line_log_data {
struct diff_ranges diff;
};
-extern void line_log_data_init(struct line_log_data *r);
-
extern void line_log_init(struct rev_info *rev, const char *prefix, struct string_list *args);
extern int line_log_filter(struct rev_info *rev);
diff --git a/pack-bitmap.c b/pack-bitmap.c
index 3281df389..365f9d92e 100644
--- a/pack-bitmap.c
+++ b/pack-bitmap.c
@@ -252,6 +252,20 @@ static int load_bitmap_entries_v1(struct bitmap_index *index)
return 0;
}
+static char *pack_bitmap_filename(struct packed_git *p)
+{
+ char *idx_name;
+ int len;
+
+ len = strlen(p->pack_name) - strlen(".pack");
+ idx_name = xmalloc(len + strlen(".bitmap") + 1);
+
+ memcpy(idx_name, p->pack_name, len);
+ memcpy(idx_name + len, ".bitmap", strlen(".bitmap") + 1);
+
+ return idx_name;
+}
+
static int open_pack_bitmap_1(struct packed_git *packfile)
{
int fd;
@@ -322,20 +336,6 @@ failed:
return -1;
}
-char *pack_bitmap_filename(struct packed_git *p)
-{
- char *idx_name;
- int len;
-
- len = strlen(p->pack_name) - strlen(".pack");
- idx_name = xmalloc(len + strlen(".bitmap") + 1);
-
- memcpy(idx_name, p->pack_name, len);
- memcpy(idx_name + len, ".bitmap", strlen(".bitmap") + 1);
-
- return idx_name;
-}
-
static int open_pack_bitmap(void)
{
struct packed_git *p;
diff --git a/pack-bitmap.h b/pack-bitmap.h
index 487600b18..0adcef77b 100644
--- a/pack-bitmap.h
+++ b/pack-bitmap.h
@@ -38,7 +38,6 @@ int prepare_bitmap_git(void);
void count_bitmap_commit_list(uint32_t *commits, uint32_t *trees, uint32_t *blobs, uint32_t *tags);
void traverse_bitmap_commit_list(show_reachable_fn show_reachable);
void test_bitmap_walk(struct rev_info *revs);
-char *pack_bitmap_filename(struct packed_git *p);
int prepare_bitmap_walk(struct rev_info *revs);
int reuse_partial_packfile_from_bitmap(struct packed_git **packfile, uint32_t *entries, off_t *up_to);
int rebuild_existing_bitmaps(struct packing_data *mapping, khash_sha1 *reused_bitmaps, int show_progress);
diff --git a/prompt.c b/prompt.c
index 8181eebbf..75406390c 100644
--- a/prompt.c
+++ b/prompt.c
@@ -73,8 +73,3 @@ char *git_prompt(const char *prompt, int flags)
}
return r;
}
-
-char *git_getpass(const char *prompt)
-{
- return git_prompt(prompt, PROMPT_ASKPASS);
-}
diff --git a/prompt.h b/prompt.h
index 04f321a78..e04cced03 100644
--- a/prompt.h
+++ b/prompt.h
@@ -5,6 +5,5 @@
#define PROMPT_ECHO (1<<1)
char *git_prompt(const char *prompt, int flags);
-char *git_getpass(const char *prompt);
#endif /* PROMPT_H */
diff --git a/remote.c b/remote.c
index 7b71ebf4b..68901b007 100644
--- a/remote.c
+++ b/remote.c
@@ -2156,7 +2156,7 @@ struct ref *get_stale_heads(struct refspec *refs, int ref_count, struct ref *fet
/*
* Compare-and-swap
*/
-void clear_cas_option(struct push_cas_option *cas)
+static void clear_cas_option(struct push_cas_option *cas)
{
int i;
diff --git a/remote.h b/remote.h
index f346524db..02d66ceff 100644
--- a/remote.h
+++ b/remote.h
@@ -261,7 +261,6 @@ struct push_cas_option {
extern int parseopt_push_cas_option(const struct option *, const char *arg, int unset);
extern int parse_push_cas_option(struct push_cas_option *, const char *arg, int unset);
-extern void clear_cas_option(struct push_cas_option *);
extern int is_empty_cas(const struct push_cas_option *);
void apply_push_cas(struct push_cas_option *, struct remote *, struct ref *);
diff --git a/revision.c b/revision.c
index 4bc851c07..66520c671 100644
--- a/revision.c
+++ b/revision.c
@@ -2970,6 +2970,61 @@ enum commit_action get_commit_action(struct rev_info *revs, struct commit *commi
return commit_show;
}
+define_commit_slab(saved_parents, struct commit_list *);
+
+#define EMPTY_PARENT_LIST ((struct commit_list *)-1)
+
+/*
+ * You may only call save_parents() once per commit (this is checked
+ * for non-root commits).
+ */
+static void save_parents(struct rev_info *revs, struct commit *commit)
+{
+ struct commit_list **pp;
+
+ if (!revs->saved_parents_slab) {
+ revs->saved_parents_slab = xmalloc(sizeof(struct saved_parents));
+ init_saved_parents(revs->saved_parents_slab);
+ }
+
+ pp = saved_parents_at(revs->saved_parents_slab, commit);
+
+ /*
+ * When walking with reflogs, we may visit the same commit
+ * several times: once for each appearance in the reflog.
+ *
+ * In this case, save_parents() will be called multiple times.
+ * We want to keep only the first set of parents. We need to
+ * store a sentinel value for an empty (i.e., NULL) parent
+ * list to distinguish it from a not-yet-saved list, however.
+ */
+ if (*pp)
+ return;
+ if (commit->parents)
+ *pp = copy_commit_list(commit->parents);
+ else
+ *pp = EMPTY_PARENT_LIST;
+}
+
+static void free_saved_parents(struct rev_info *revs)
+{
+ if (revs->saved_parents_slab)
+ clear_saved_parents(revs->saved_parents_slab);
+}
+
+struct commit_list *get_saved_parents(struct rev_info *revs, const struct commit *commit)
+{
+ struct commit_list *parents;
+
+ if (!revs->saved_parents_slab)
+ return commit->parents;
+
+ parents = *saved_parents_at(revs->saved_parents_slab, commit);
+ if (parents == EMPTY_PARENT_LIST)
+ return NULL;
+ return parents;
+}
+
enum commit_action simplify_commit(struct rev_info *revs, struct commit *commit)
{
enum commit_action action = get_commit_action(revs, commit);
@@ -3269,54 +3324,3 @@ void put_revision_mark(const struct rev_info *revs, const struct commit *commit)
fputs(mark, stdout);
putchar(' ');
}
-
-define_commit_slab(saved_parents, struct commit_list *);
-
-#define EMPTY_PARENT_LIST ((struct commit_list *)-1)
-
-void save_parents(struct rev_info *revs, struct commit *commit)
-{
- struct commit_list **pp;
-
- if (!revs->saved_parents_slab) {
- revs->saved_parents_slab = xmalloc(sizeof(struct saved_parents));
- init_saved_parents(revs->saved_parents_slab);
- }
-
- pp = saved_parents_at(revs->saved_parents_slab, commit);
-
- /*
- * When walking with reflogs, we may visit the same commit
- * several times: once for each appearance in the reflog.
- *
- * In this case, save_parents() will be called multiple times.
- * We want to keep only the first set of parents. We need to
- * store a sentinel value for an empty (i.e., NULL) parent
- * list to distinguish it from a not-yet-saved list, however.
- */
- if (*pp)
- return;
- if (commit->parents)
- *pp = copy_commit_list(commit->parents);
- else
- *pp = EMPTY_PARENT_LIST;
-}
-
-struct commit_list *get_saved_parents(struct rev_info *revs, const struct commit *commit)
-{
- struct commit_list *parents;
-
- if (!revs->saved_parents_slab)
- return commit->parents;
-
- parents = *saved_parents_at(revs->saved_parents_slab, commit);
- if (parents == EMPTY_PARENT_LIST)
- return NULL;
- return parents;
-}
-
-void free_saved_parents(struct rev_info *revs)
-{
- if (revs->saved_parents_slab)
- clear_saved_parents(revs->saved_parents_slab);
-}
diff --git a/revision.h b/revision.h
index 17ebafc4c..0ea8b4e25 100644
--- a/revision.h
+++ b/revision.h
@@ -300,18 +300,14 @@ extern int rewrite_parents(struct rev_info *revs, struct commit *commit,
rewrite_parent_fn_t rewrite_parent);
/*
- * Save a copy of the parent list, and return the saved copy. This is
- * used by the log machinery to retrieve the original parents when
- * commit->parents has been modified by history simpification.
- *
- * You may only call save_parents() once per commit (this is checked
- * for non-root commits).
+ * The log machinery saves the original parent list so that
+ * get_saved_parents() can later tell what the real parents of the
+ * commits are, when commit->parents has been modified by history
+ * simpification.
*
* get_saved_parents() will transparently return commit->parents if
* history simplification is off.
*/
-extern void save_parents(struct rev_info *revs, struct commit *commit);
extern struct commit_list *get_saved_parents(struct rev_info *revs, const struct commit *commit);
-extern void free_saved_parents(struct rev_info *revs);
#endif
diff --git a/shallow.c b/shallow.c
index f5e67204a..d8bf40ad4 100644
--- a/shallow.c
+++ b/shallow.c
@@ -137,7 +137,7 @@ struct commit_list *get_shallow_commits(struct object_array *heads, int depth,
return result;
}
-void check_shallow_file_for_update(void)
+static void check_shallow_file_for_update(void)
{
if (is_shallow == -1)
die("BUG: shallow must be initialized by now");
diff --git a/urlmatch.c b/urlmatch.c
index 618d21649..132d342bc 100644
--- a/urlmatch.c
+++ b/urlmatch.c
@@ -412,9 +412,9 @@ static size_t url_match_prefix(const char *url,
return 0;
}
-int match_urls(const struct url_info *url,
- const struct url_info *url_prefix,
- int *exactusermatch)
+static int match_urls(const struct url_info *url,
+ const struct url_info *url_prefix,
+ int *exactusermatch)
{
/*
* url_prefix matches url if the scheme, host and port of url_prefix
diff --git a/urlmatch.h b/urlmatch.h
index b461dfd3d..528862adc 100644
--- a/urlmatch.h
+++ b/urlmatch.h
@@ -31,7 +31,6 @@ struct url_info {
};
extern char *url_normalize(const char *, struct url_info *);
-extern int match_urls(const struct url_info *url, const struct url_info *url_prefix, int *exactusermatch);
struct urlmatch_item {
size_t matched_len;