From: Junio C Hamano Date: Wed, 26 Oct 2022 00:11:37 +0000 (-0700) Subject: Merge branch 'jc/branch-description-unset' into maint-2.38 X-Git-Tag: v2.39.0-rc0~82^2~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1155c8efbb152ecb5fb9e1414245f4ab637f37ab;p=thirdparty%2Fgit.git Merge branch 'jc/branch-description-unset' into maint-2.38 "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 --- 1155c8efbb152ecb5fb9e1414245f4ab637f37ab diff --cc t/t3200-branch.sh index 88b9c56e5c,30dff9e712..c7ec1c7520 --- a/t/t3200-branch.sh +++ b/t/t3200-branch.sh @@@ -1368,20 -1267,10 +1368,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