clone only required ref in git_clone
This commit is contained in:
parent
8c2e4b6ad1
commit
8b98574565
16
Makefile
16
Makefile
|
@ -161,11 +161,17 @@ check_executables := $(foreach exec,$(executables),\$(if \
|
|||
$(shell which $(exec)),some string,$(error "No $(exec) in PATH")))
|
||||
|
||||
define git_clone
|
||||
[ -d $(1) ] || git clone $(2) $(1)
|
||||
git -C $(1) checkout $(3)
|
||||
git -C $(1) rev-parse --verify HEAD | grep -q $(3) || { \
|
||||
echo 'Error: Git ref/branch collision.'; exit 1; \
|
||||
};
|
||||
[ -d $(1) ] || \
|
||||
mkdir -p $(FETCH_DIR) && \
|
||||
mkdir $(1).tmp && \
|
||||
git -C $(1).tmp init && \
|
||||
git -C $(1).tmp remote add origin $(2) && \
|
||||
git -C $(1).tmp fetch origin $(3) && \
|
||||
git -C $(1).tmp -c advice.detachedHead=false checkout $(3) && \
|
||||
git -C $(1).tmp rev-parse --verify HEAD | grep -q $(3) || { \
|
||||
echo 'Error: Git ref/branch collision.'; exit 1; \
|
||||
} && \
|
||||
mv $(1).tmp $(1);
|
||||
endef
|
||||
|
||||
define apply_patches
|
||||
|
|
Reference in New Issue