diff --git a/scripts/cp.sh b/scripts/cp.sh index 2a52658..e172623 100644 --- a/scripts/cp.sh +++ b/scripts/cp.sh @@ -35,8 +35,7 @@ else git fetch --all for commit_hash in $commit_hashes; do # Check if commit exists in current branch - cmt=$(git branch -r --contains $commit_hash | sed 's/origin\///') - cmt=$(echo "$cmt" | sed 's/^[ \t]*//;s/[ \t]*$//') + cmt=$(git branch -r --contains 58f5241 | sed 's/origin\///' | grep -v 'HEAD' | awk '{print $1}') echo "cmt2=$cmt" if [ -z "$cmt" ]; then echo "Commit $commit_hash does not exists"