mirror of
https://github.com/git/git
synced 2024-08-27 03:29:21 +00:00
34 lines
691 B
C
34 lines
691 B
C
|
/*
|
||
|
* Builtin "git pull"
|
||
|
*
|
||
|
* Based on git-pull.sh by Junio C Hamano
|
||
|
*
|
||
|
* Fetch one or more remote refs and merge it/them into the current HEAD.
|
||
|
*/
|
||
|
#include "cache.h"
|
||
|
#include "builtin.h"
|
||
|
#include "parse-options.h"
|
||
|
#include "exec_cmd.h"
|
||
|
|
||
|
static const char * const pull_usage[] = {
|
||
|
NULL
|
||
|
};
|
||
|
|
||
|
static struct option pull_options[] = {
|
||
|
OPT_END()
|
||
|
};
|
||
|
|
||
|
int cmd_pull(int argc, const char **argv, const char *prefix)
|
||
|
{
|
||
|
if (!getenv("_GIT_USE_BUILTIN_PULL")) {
|
||
|
const char *path = mkpath("%s/git-pull", git_exec_path());
|
||
|
|
||
|
if (sane_execvp(path, (char **)argv) < 0)
|
||
|
die_errno("could not exec %s", path);
|
||
|
}
|
||
|
|
||
|
argc = parse_options(argc, argv, prefix, pull_options, pull_usage, 0);
|
||
|
|
||
|
return 0;
|
||
|
}
|