kiss: simplify pkg_source_git

This commit is contained in:
Dylan Araps 2021-08-28 15:48:59 +03:00
parent 993bea5ba0
commit 6a00546b3b
No known key found for this signature in database
GPG Key ID: 13295DAC2CF13B5C

6
kiss
View File

@ -454,10 +454,8 @@ pkg_source_git() {
git remote set-url origin "${2%[#@]*}" 2>/dev/null ||
git remote add origin "${2%[#@]*}"
# Only fetch latest changes if not <url>[#]<sha|tag>.
case $2 in *"#$com") ;; *)
git fetch -t --filter=tree:0 origin "$com" || git fetch -t
esac
git fetch -t origin "$com" ||
git fetch -t
git -c advice.detachedHead=0 checkout "${com:-FETCH_HEAD}"
}