Skip to content

Commit c985aaf

Browse files
committed
Merge branch 'jc/unused-symbols'
Mark file-local symbols as "static", and drop functions that nobody uses. * jc/unused-symbols: shallow.c: make check_shallow_file_for_update() static remote.c: make clear_cas_option() static urlmatch.c: make match_urls() static revision.c: make save_parents() and free_saved_parents() static line-log.c: make line_log_data_init() static pack-bitmap.c: make pack_bitmap_filename() static prompt.c: remove git_getpass() nobody uses http.c: make finish_active_slot() and handle_curl_result() static
2 parents cba07bb + 167832c commit c985aaf

16 files changed

+111
-125
lines changed

commit.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,6 @@ extern int for_each_commit_graft(each_commit_graft_fn, void *);
254254
extern int is_repository_shallow(void);
255255
extern struct commit_list *get_shallow_commits(struct object_array *heads,
256256
int depth, int shallow_flag, int not_shallow_flag);
257-
extern void check_shallow_file_for_update(void);
258257
extern void set_alternate_shallow_file(const char *path, int override);
259258
extern int write_shallow_commits(struct strbuf *out, int use_pack_protocol,
260259
const struct sha1_array *extra);

http.c

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,37 @@ size_t fwrite_null(char *ptr, size_t eltsize, size_t nmemb, void *strbuf)
117117
return eltsize * nmemb;
118118
}
119119

120+
static void closedown_active_slot(struct active_request_slot *slot)
121+
{
122+
active_requests--;
123+
slot->in_use = 0;
124+
}
125+
126+
static void finish_active_slot(struct active_request_slot *slot)
127+
{
128+
closedown_active_slot(slot);
129+
curl_easy_getinfo(slot->curl, CURLINFO_HTTP_CODE, &slot->http_code);
130+
131+
if (slot->finished != NULL)
132+
(*slot->finished) = 1;
133+
134+
/* Store slot results so they can be read after the slot is reused */
135+
if (slot->results != NULL) {
136+
slot->results->curl_result = slot->curl_result;
137+
slot->results->http_code = slot->http_code;
138+
#if LIBCURL_VERSION_NUM >= 0x070a08
139+
curl_easy_getinfo(slot->curl, CURLINFO_HTTPAUTH_AVAIL,
140+
&slot->results->auth_avail);
141+
#else
142+
slot->results->auth_avail = 0;
143+
#endif
144+
}
145+
146+
/* Run callback if appropriate */
147+
if (slot->callback_func != NULL)
148+
slot->callback_func(slot->callback_data);
149+
}
150+
120151
#ifdef USE_CURL_MULTI
121152
static void process_curl_messages(void)
122153
{
@@ -736,12 +767,6 @@ void run_active_slot(struct active_request_slot *slot)
736767
#endif
737768
}
738769

739-
static void closedown_active_slot(struct active_request_slot *slot)
740-
{
741-
active_requests--;
742-
slot->in_use = 0;
743-
}
744-
745770
static void release_active_slot(struct active_request_slot *slot)
746771
{
747772
closedown_active_slot(slot);
@@ -758,31 +783,6 @@ static void release_active_slot(struct active_request_slot *slot)
758783
#endif
759784
}
760785

761-
void finish_active_slot(struct active_request_slot *slot)
762-
{
763-
closedown_active_slot(slot);
764-
curl_easy_getinfo(slot->curl, CURLINFO_HTTP_CODE, &slot->http_code);
765-
766-
if (slot->finished != NULL)
767-
(*slot->finished) = 1;
768-
769-
/* Store slot results so they can be read after the slot is reused */
770-
if (slot->results != NULL) {
771-
slot->results->curl_result = slot->curl_result;
772-
slot->results->http_code = slot->http_code;
773-
#if LIBCURL_VERSION_NUM >= 0x070a08
774-
curl_easy_getinfo(slot->curl, CURLINFO_HTTPAUTH_AVAIL,
775-
&slot->results->auth_avail);
776-
#else
777-
slot->results->auth_avail = 0;
778-
#endif
779-
}
780-
781-
/* Run callback if appropriate */
782-
if (slot->callback_func != NULL)
783-
slot->callback_func(slot->callback_data);
784-
}
785-
786786
void finish_all_active_slots(void)
787787
{
788788
struct active_request_slot *slot = active_queue_head;
@@ -845,7 +845,7 @@ char *get_remote_object_url(const char *url, const char *hex,
845845
return strbuf_detach(&buf, NULL);
846846
}
847847

848-
int handle_curl_result(struct slot_results *results)
848+
static int handle_curl_result(struct slot_results *results)
849849
{
850850
/*
851851
* If we see a failing http code with CURLE_OK, we have turned off

http.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,7 @@ extern curlioerr ioctl_buffer(CURL *handle, int cmd, void *clientp);
8585
extern struct active_request_slot *get_active_slot(void);
8686
extern int start_active_slot(struct active_request_slot *slot);
8787
extern void run_active_slot(struct active_request_slot *slot);
88-
extern void finish_active_slot(struct active_request_slot *slot);
8988
extern void finish_all_active_slots(void);
90-
extern int handle_curl_result(struct slot_results *results);
9189

9290
/*
9391
* This will run one slot to completion in a blocking manner, similar to how

line-log.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ static void diff_ranges_release(struct diff_ranges *diff)
237237
range_set_release(&diff->target);
238238
}
239239

240-
void line_log_data_init(struct line_log_data *r)
240+
static void line_log_data_init(struct line_log_data *r)
241241
{
242242
memset(r, 0, sizeof(struct line_log_data));
243243
range_set_init(&r->ranges, 0);

line-log.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,6 @@ struct line_log_data {
5454
struct diff_ranges diff;
5555
};
5656

57-
extern void line_log_data_init(struct line_log_data *r);
58-
5957
extern void line_log_init(struct rev_info *rev, const char *prefix, struct string_list *args);
6058

6159
extern int line_log_filter(struct rev_info *rev);

pack-bitmap.c

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,20 @@ static int load_bitmap_entries_v1(struct bitmap_index *index)
252252
return 0;
253253
}
254254

255+
static char *pack_bitmap_filename(struct packed_git *p)
256+
{
257+
char *idx_name;
258+
int len;
259+
260+
len = strlen(p->pack_name) - strlen(".pack");
261+
idx_name = xmalloc(len + strlen(".bitmap") + 1);
262+
263+
memcpy(idx_name, p->pack_name, len);
264+
memcpy(idx_name + len, ".bitmap", strlen(".bitmap") + 1);
265+
266+
return idx_name;
267+
}
268+
255269
static int open_pack_bitmap_1(struct packed_git *packfile)
256270
{
257271
int fd;
@@ -322,20 +336,6 @@ static int load_pack_bitmap(void)
322336
return -1;
323337
}
324338

325-
char *pack_bitmap_filename(struct packed_git *p)
326-
{
327-
char *idx_name;
328-
int len;
329-
330-
len = strlen(p->pack_name) - strlen(".pack");
331-
idx_name = xmalloc(len + strlen(".bitmap") + 1);
332-
333-
memcpy(idx_name, p->pack_name, len);
334-
memcpy(idx_name + len, ".bitmap", strlen(".bitmap") + 1);
335-
336-
return idx_name;
337-
}
338-
339339
static int open_pack_bitmap(void)
340340
{
341341
struct packed_git *p;

pack-bitmap.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ int prepare_bitmap_git(void);
3838
void count_bitmap_commit_list(uint32_t *commits, uint32_t *trees, uint32_t *blobs, uint32_t *tags);
3939
void traverse_bitmap_commit_list(show_reachable_fn show_reachable);
4040
void test_bitmap_walk(struct rev_info *revs);
41-
char *pack_bitmap_filename(struct packed_git *p);
4241
int prepare_bitmap_walk(struct rev_info *revs);
4342
int reuse_partial_packfile_from_bitmap(struct packed_git **packfile, uint32_t *entries, off_t *up_to);
4443
int rebuild_existing_bitmaps(struct packing_data *mapping, khash_sha1 *reused_bitmaps, int show_progress);

prompt.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,3 @@ char *git_prompt(const char *prompt, int flags)
7373
}
7474
return r;
7575
}
76-
77-
char *git_getpass(const char *prompt)
78-
{
79-
return git_prompt(prompt, PROMPT_ASKPASS);
80-
}

prompt.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,5 @@
55
#define PROMPT_ECHO (1<<1)
66

77
char *git_prompt(const char *prompt, int flags);
8-
char *git_getpass(const char *prompt);
98

109
#endif /* PROMPT_H */

remote.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2156,7 +2156,7 @@ struct ref *get_stale_heads(struct refspec *refs, int ref_count, struct ref *fet
21562156
/*
21572157
* Compare-and-swap
21582158
*/
2159-
void clear_cas_option(struct push_cas_option *cas)
2159+
static void clear_cas_option(struct push_cas_option *cas)
21602160
{
21612161
int i;
21622162

0 commit comments

Comments
 (0)