From: Junio C Hamano Date: Mon, 17 Oct 2022 21:56:33 +0000 (-0700) Subject: Merge branch 'jc/branch-description-unset' X-Git-Tag: v2.39.0-rc0~109 X-Git-Url: http://git.ipfire.org/?p=thirdparty%2Fgit.git;a=commitdiff_plain;h=272be0db8b732617245930b92c9a79a1fc5b4398 Merge branch 'jc/branch-description-unset' "GIT_EDITOR=: git branch --edit-description" resulted in failure, which has been corrected. * jc/branch-description-unset: branch: do not fail a no-op --edit-desc --- 272be0db8b732617245930b92c9a79a1fc5b4398 diff --cc t/t3200-branch.sh index b82cffc0b3,30dff9e712..d5a1fc1375 --- a/t/t3200-branch.sh +++ b/t/t3200-branch.sh @@@ -1367,20 -1267,10 +1367,23 @@@ test_expect_success 'attempt to delete test_must_fail git branch -d my10 ' +test_expect_success 'branch --delete --force removes dangling branch' ' + git checkout main && + test_commit unstable && + hash=$(git rev-parse HEAD) && + objpath=$(echo $hash | sed -e "s|^..|.git/objects/&/|") && + git branch --no-track dangling && + mv $objpath $objpath.x && + test_when_finished "mv $objpath.x $objpath" && + git branch --delete --force dangling && + git for-each-ref refs/heads/dangling >actual && + test_must_be_empty actual +' + test_expect_success 'use --edit-description' ' + EDITOR=: git branch --edit-description && + test_must_fail git config branch.main.description && + write_script editor <<-\EOF && echo "New contents" >"$1" EOF