<div dir="ltr"><div><div>This patch handles the detached HEAD case, by using git branch --contains HEAD to get the branch (or a list of possible branches).<br><br></div>It also adds a option to specify the branch in case this logic fails. Also there is an option to override the base source url for downloading.<br>

<br></div>While I was at it, I adjusted some checks so that the script will run even if the name of the checkout directory is not $packagename.<br></div>