From 0eb05feb3fdb9421b027f47210fffdd1716e6594 Mon Sep 17 00:00:00 2001 From: Jean Guyader Date: Tue, 17 Nov 2009 16:02:23 +0000 Subject: [PATCH] buildroot: Add git pull script. --- project/Makefile.in | 1 + scripts/git_pull.sh | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100755 scripts/git_pull.sh diff --git a/project/Makefile.in b/project/Makefile.in index d615b63..69c38ab 100644 --- a/project/Makefile.in +++ b/project/Makefile.in @@ -99,4 +99,5 @@ VENDOR_PATCH_DIR:=$(strip $(subst ",,$(BR2_VENDOR_PATCH_DIR))) #")) GIT_CHECKOUT="$(BASE_DIR)/scripts/git_checkout.sh" +GIT_PULL="$(BASE_DIR)/scripts/git_pull.sh" diff --git a/scripts/git_pull.sh b/scripts/git_pull.sh new file mode 100755 index 0000000..492b750 --- /dev/null +++ b/scripts/git_pull.sh @@ -0,0 +1,32 @@ +#! /bin/sh + +path="$1" + +git_head() +{ + ( cd "$path" && git-rev-list HEAD | head -n 1) +} + + +git_pull() +{ + pushd "$path" + if [ -d ".git/patches/master" ]; then + guilt-pop -a + ( cd ".git/patches/master" && git pull) + fi + + git pull + + [ -d ".git/patches/master" ] && guilt-push -a + + popd +} + +head=`git_head` +git_pull +new_head=`git_head` + +[ "$head" == "$new_head" ] && exit 0 + +exit 1 -- 2.39.5