From: Junio C Hamano Date: Mon, 5 Mar 2012 06:17:52 +0000 (-0800) Subject: Merge branch 'cn/maint-branch-with-bad' into maint X-Git-Tag: v1.7.9.3~5 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=57f75f31311d380a3ccfbfe7f483253591cf0c87;p=git.git Merge branch 'cn/maint-branch-with-bad' into maint * cn/maint-branch-with-bad: branch: don't assume the merge filter ref exists Conflicts: t/t3200-branch.sh --- 57f75f31311d380a3ccfbfe7f483253591cf0c87 diff --cc t/t3200-branch.sh index dd1acebd8,6ad1763fd..9fe1d8fea --- a/t/t3200-branch.sh +++ b/t/t3200-branch.sh @@@ -617,40 -620,8 +617,44 @@@ test_expect_success 'use set-upstream o ' +test_expect_success 'use --edit-description' ' + write_script editor <<-\EOF && + echo "New contents" >"$1" + EOF + EDITOR=./editor git branch --edit-description && + write_script editor <<-\EOF && + git stripspace -s <"$1" >"EDITOR_OUTPUT" + EOF + EDITOR=./editor git branch --edit-description && + echo "New contents" >expect && + test_cmp EDITOR_OUTPUT expect +' + +test_expect_success 'detect typo in branch name when using --edit-description' ' + write_script editor <<-\EOF && + echo "New contents" >"$1" + EOF + ( + EDITOR=./editor && + export EDITOR && + test_must_fail git branch --edit-description no-such-branch + ) +' + +test_expect_success 'refuse --edit-description on unborn branch for now' ' + write_script editor <<-\EOF && + echo "New contents" >"$1" + EOF + git checkout --orphan unborn && + ( + EDITOR=./editor && + export EDITOR && + test_must_fail git branch --edit-description + ) +' + + test_expect_success '--merged catches invalid object names' ' + test_must_fail git branch --merged 0000000000000000000000000000000000000000 + ' + test_done