Anonymous avatar Anonymous committed 2ab141a

[PATCH] Possible cleanups for local-pull.c

Hi. This patch contains the following possible cleanups:

* Make some needlessly global functions in local-pull.c static
* Change 'char *' to 'const char *' where appropriate

Signed-off-by: Peter Hagervall <hager@cs.umu.se>;
Signed-off-by: Junio C Hamano <junkio@cox.net>;

Comments (0)

Files changed (3)

 extern struct ref **get_remote_heads(int in, struct ref **list, int nr_match, char **match);
 
 extern struct packed_git *parse_pack_index(unsigned char *sha1);
-extern struct packed_git *parse_pack_index_file(unsigned char *sha1, 
+extern struct packed_git *parse_pack_index_file(const unsigned char *sha1,
 						char *idx_path);
 
 extern void prepare_packed_git(void);
 
 static struct packed_git *packs = NULL;
 
-void setup_index(unsigned char *sha1)
+static void setup_index(unsigned char *sha1)
 {
 	struct packed_git *new_pack;
 	char filename[PATH_MAX];
 	packs = new_pack;
 }
 
-int setup_indices()
+static int setup_indices(void)
 {
 	DIR *dir;
 	struct dirent *de;
 	return 0;
 }
 
-int copy_file(const char *source, const char *dest, const char *hex)
+static int copy_file(const char *source, const char *dest, const char *hex)
 {
 	if (use_link) {
 		if (!link(source, dest)) {
 	return -1;
 }
 
-int fetch_pack(unsigned char *sha1)
+static int fetch_pack(const unsigned char *sha1)
 {
 	struct packed_git *target;
 	char filename[PATH_MAX];
 	return 0;
 }
 
-int fetch_file(unsigned char *sha1)
+static int fetch_file(const unsigned char *sha1)
 {
 	static int object_name_start = -1;
 	static char filename[PATH_MAX];
 	return parse_pack_index_file(sha1, path);
 }
 
-struct packed_git *parse_pack_index_file(unsigned char *sha1, char *idx_path)
+struct packed_git *parse_pack_index_file(const unsigned char *sha1, char *idx_path)
 {
 	struct packed_git *p;
 	unsigned long idx_size;
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.