summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenton Liu2020-05-23 01:49:20 -0400
committerDenton Liu2020-05-23 01:53:04 -0400
commit70ef9c8682956dbf2b875817028bf3bfa513fd3f (patch)
tree5ed25643a0c32c8d2f760c0857efead75ae1d492
parentae39d1e28b7e7d1c8cd0aef00bee7895cbeb13d4 (diff)
downloadaur-70ef9c8682956dbf2b875817028bf3bfa513fd3f.tar.gz
update-branch.sh: make it without a specific branch structure
While we're at it, update to work with Git v2.26.0 and make the script a little more idiomatic.
-rwxr-xr-xupdate-branch.sh12
1 files changed, 5 insertions, 7 deletions
diff --git a/update-branch.sh b/update-branch.sh
index 7326e37949d0..652469336e3e 100755
--- a/update-branch.sh
+++ b/update-branch.sh
@@ -1,14 +1,12 @@
#!/bin/sh
+REMOTE_URL=https://git.archlinux.org/svntogit/community.git
REMOTE_BRANCH=packages/ddclient
LOCAL_BRANCH=upstream
-CURRENT_BRANCH=`git rev-parse --abbrev-ref HEAD`
-git checkout "$REMOTE_BRANCH"
-git pull
-git branch -f "$LOCAL_BRANCH" "$REMOTE_BRANCH"
-git checkout "$LOCAL_BRANCH"
-git filter-branch -f --subdirectory-filter trunk \
+git fetch "$REMOTE_URL" "$REMOTE_BRANCH"
+git checkout -B "$LOCAL_BRANCH" FETCH_HEAD
+FILTER_BRANCH_SQUELCH_WARNING=1 git filter-branch -f --subdirectory-filter trunk \
--tree-filter 'makepkg --printsrcinfo > .SRCINFO || rm .SRCINFO' \
--commit-filter '
if [ -e .SRCINFO ]
@@ -23,4 +21,4 @@ git filter-branch -f --subdirectory-filter trunk \
shift
done
fi'
-git checkout "$CURRENT_BRANCH"
+git checkout -