Err, yes, thanks, I didn't recognize my own bad code.   Used your latter suggestion albeit without the [ -n "$FEATURE_BRANCH" ] which might be unneeded.  
Hmm.  How would FEATURE_BRANCH ever be empty?