From 3382beadcc047405336e5e0476dfa03c4863497b Mon Sep 17 00:00:00 2001 From: Brian Stinson Date: Apr 16 2019 14:59:13 +0000 Subject: Get the proper branch name from the remote instead of the local branch name. This allows you to clone a commit directly by its hash, and not be required to set up a tracking branch (with a matching name) to its upstream. --- diff --git a/get_sources.sh b/get_sources.sh index 84e3a8e..44ef936 100755 --- a/get_sources.sh +++ b/get_sources.sh @@ -181,7 +181,7 @@ else else branches=("${branches[@]}" "$branch") fi - done <<< "$(git branch --contains HEAD)" + done <<< "$(git branch -r --contains HEAD | sed 's#origin/##g')" fi while read -r fsha fname ; do if [ ".${fsha}" = ".da39a3ee5e6b4b0d3255bfef95601890afd80709" ]; then