From 1da62670810ccb26988c676982ab29d3f407183f Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Sat, 14 Jun 2008 13:07:58 +0200 Subject: In update: fetch once, then for each branch (crate and) merge. --- make/git.mk | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'make') diff --git a/make/git.mk b/make/git.mk index f8436f8..068e7f3 100644 --- a/make/git.mk +++ b/make/git.mk @@ -11,8 +11,10 @@ currentbranch = $(shell git branch | grep ^\* | awk '{ print $2 }') noncurrentbranches = $(filter-out $(currentbranch),$(branches)) update: - $(if $(filter $(currentbranch),$(master)),,git checkout "$(master)") - git pull + git fetch $(origin) + $(if $(filter $(currentbranch),$(master)),,git branch -f "$(master)" "$(origin)/$(master)" && git checkout "$(master)") + git merge --no-commit "$(origin)" + $(if $(noncurrentbranches),$(foreach branch,$(noncurrentbranches),git branch -f "$(branch)" "$(origin)/$(branch)" && git checkout "$(branch)" && git merge --no-commit "$(origin)" &&) git checkout "$(master)") init: # Assume that initial cloning is done already when invoking this target -- cgit v1.2.3