{"thread":{"id":"5777","subject":"[PATCH 2/2] Clean up \"git-branch.sh\" and add remove recursive dir test cases.","startedAt":"2006-10-01T12:38:18Z","lastAt":"2006-10-01T12:38:18Z","messageCount":1,"participants":["Christian Couder"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"28063","messageId":"20061001143818.c9f95ab5.chriscool@tuxfamily.org","threadId":"5777","inReplyTo":null,"subject":"[PATCH 2/2] Clean up \"git-branch.sh\" and add remove recursive dir test cases.","fromName":"Christian Couder","fromEmail":"chriscool@tuxfamily.org","sentAt":"2006-10-01T12:38:18Z","receivedAt":"2006-10-01T12:38:18Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"Now that directory recursive remove works in the core C code, we\ndon't need to do it in \"git-branch.sh\".\n\nAlso add test cases to check that directory recursive remove will\ncontinue to work.\n\nSigned-off-by: Christian Couder <chriscool@tuxfamily.org>\n---\n git-branch.sh        |   10 ----------\n t/t3210-pack-refs.sh |   27 +++++++++++++++++++++++++++\n 2 files changed, 27 insertions(+), 10 deletions(-)\n\ndiff --git a/git-branch.sh b/git-branch.sh\nindex bf84b30..4379a07 100755\n--- a/git-branch.sh\n+++ b/git-branch.sh\n@@ -111,16 +111,6 @@ rev=$(git-rev-parse --verify \"$head\") ||\n git-check-ref-format \"heads/$branchname\" ||\n \tdie \"we do not like '$branchname' as a branch name.\"\n \n-if [ -d \"$GIT_DIR/refs/heads/$branchname\" ]\n-then\n-\tfor refdir in `cd \"$GIT_DIR\" && \\\n-\t\tfind \"refs/heads/$branchname\" -type d | sort -r`\n-\tdo\n-\t\trmdir \"$GIT_DIR/$refdir\" || \\\n-\t\t    die \"Could not delete '$refdir', there may still be a ref there.\"\n-\tdone\n-fi\n-\n prev=''\n if git-show-ref --verify --quiet -- \"refs/heads/$branchname\"\n then\ndiff --git a/t/t3210-pack-refs.sh b/t/t3210-pack-refs.sh\nindex 193fe1f..f31e79c 100755\n--- a/t/t3210-pack-refs.sh\n+++ b/t/t3210-pack-refs.sh\n@@ -67,4 +67,31 @@ test_expect_success \\\n      git-pack-refs &&\n      git-branch -d g'\n \n+test_expect_failure \\\n+    'git branch i/j/k should barf if branch i exists' \\\n+    'git-branch i &&\n+     git-pack-refs --prune &&\n+     git-branch i/j/k'\n+\n+test_expect_success \\\n+    'test git branch k after branch k/l/m and k/lm have been deleted' \\\n+    'git-branch k/l &&\n+     git-branch k/lm &&\n+     git-branch -d k/l &&\n+     git-branch k/l/m &&\n+     git-branch -d k/l/m &&\n+     git-branch -d k/lm &&\n+     git-branch k'\n+\n+test_expect_success \\\n+    'test git branch n after some branch deletion and pruning' \\\n+    'git-branch n/o &&\n+     git-branch n/op &&\n+     git-branch -d n/o &&\n+     git-branch n/o/p &&\n+     git-branch -d n/op &&\n+     git-pack-refs --prune &&\n+     git-branch -d n/o/p &&\n+     git-branch n'\n+\n test_done\n-- \n1.4.2.1.g7bc701-dirty\n"}]}