Make pull() take some implicit data as explicit arguments
Currently it's a bit weird that pull() takes a single argument describing the commit but takes the write_ref from a global variable. This makes it take that as a parameter as well, which might be nicer for the libification in the future, but especially it will make for nicer code when we implement pull()ing multiple commits at once. Signed-off-by: Petr Baudis <pasky@suse.cz> Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:

committed by
Junio C Hamano

parent
c2c487cf3a
commit
c6b69bdbc1
@ -1216,6 +1216,7 @@ int fetch_ref(char *ref, unsigned char *sha1)
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
const char *write_ref = NULL;
|
||||
char *commit_id;
|
||||
char *url;
|
||||
char *path;
|
||||
@ -1250,7 +1251,6 @@ int main(int argc, char **argv)
|
||||
}
|
||||
commit_id = argv[arg];
|
||||
url = argv[arg + 1];
|
||||
write_ref_log_details = url;
|
||||
|
||||
http_init();
|
||||
|
||||
@ -1268,7 +1268,7 @@ int main(int argc, char **argv)
|
||||
alt->path_len = strlen(path);
|
||||
}
|
||||
|
||||
if (pull(commit_id))
|
||||
if (pull(commit_id, write_ref, url))
|
||||
rc = 1;
|
||||
|
||||
http_cleanup();
|
||||
|
Reference in New Issue
Block a user