]> git.ozlabs.org Git - next-scripts/blobdiff - fetch_trees
fetch_trees: skip the "branch" control lines
[next-scripts] / fetch_trees
index 88efd947fb3c2517cb238208adfe84e0322da429..b15e35baf0f656863352d7ce5e8cf9c9002f1300 100755 (executable)
@@ -5,7 +5,7 @@
 [ "$1" = "-n" ] && {
        shift
        last=$(tail -n1 $SHA1_FILE | cut -f1 -d$'\t')
-       start_from=$(awk -F '\t' '$3 == "'$last'" { getline; print $3; exit 0; }' $CTRL_FILE)
+       start_from=$(awk -F '\t' '$3 == "'$last'" { do getline; while (/^#/ || $2 == "branch"); print $3; exit 0; }' $CTRL_FILE)
 }
 
 [ "$1" = "-s" ] && {