author | Junio C Hamano <gitster@pobox.com> | |
Mon, 5 Mar 2012 06:17:52 +0000 (22:17 -0800) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 5 Mar 2012 06:17:52 +0000 (22:17 -0800) |
* cn/maint-branch-with-bad:
branch: don't assume the merge filter ref exists
Conflicts:
t/t3200-branch.sh
branch: don't assume the merge filter ref exists
Conflicts:
t/t3200-branch.sh
1 | 2 | |||
---|---|---|---|---|
builtin/branch.c | patch | | diff1 | | diff2 | | blob | history |
t/t3200-branch.sh | patch | | diff1 | | diff2 | | blob | history |
diff --cc builtin/branch.c
Simple merge
diff --cc t/t3200-branch.sh
index dd1acebd88070b75bbbfd07048b5a255aa00e0f3,6ad1763fda28cb86daf7e6baa901814d1a343517..9fe1d8feab419e1a8065b2ea5881f991edc68855
--- 1/t/t3200-branch.sh
--- 2/t/t3200-branch.sh
+++ b/t/t3200-branch.sh
'
+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