t9502: fix &&-chain breakage
[gitweb.git] / t / t6300-for-each-ref.sh
index bda354c1c48bce9fc6fdc442c3ec89fb034f20d3..c66bf7981c5328356005963e15262c8d870ac61c 100755 (executable)
@@ -334,6 +334,19 @@ test_expect_success 'Check that :track[short] cannot be used with other atoms' '
        test_must_fail git for-each-ref --format="%(refname:trackshort)" 2>/dev/null
 '
 
+test_expect_success 'Check that :track[short] works when upstream is invalid' '
+       cat >expected <<-\EOF &&
+
+
+       EOF
+       test_when_finished "git config branch.master.merge refs/heads/master" &&
+       git config branch.master.merge refs/heads/does-not-exist &&
+       git for-each-ref \
+               --format="%(upstream:track)$LF%(upstream:trackshort)" \
+               refs/heads >actual &&
+       test_cmp expected actual
+'
+
 cat >expected <<EOF
 $(git rev-parse --short HEAD)
 EOF