[PATCH] D65416: Fix git-llvm to not delete non-empty directories.

James Y Knight via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 29 13:55:55 PDT 2019


jyknight created this revision.
jyknight added reviewers: mehdi_amini, jlebar, rupprecht.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Previously, if a directory contained only other sub-directories, one
of which was being removed, git llvm would delete the parent and all
its subdirs, even though only one should've been deleted.

This error occurred in r366590, where the commit attempted to remove
lldb/packages/Python/lldbsuite/test/tools/lldb-mi, but git-llvm
erroneously removed the entire contents of
lldb/packages/Python/lldbsuite/test/tools.

This happened because "git apply" automatically removes empty
directories locally, and the absence of a local directory was
previously taken as an indication to call 'svn rm' on that
directory. However, an empty local directory does not necessarily
indicate that the directory is truly empty.

Fix that by removing directories only when they're empty on the git
side.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D65416

Files:
  llvm/utils/git-svn/git-llvm

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D65416.212219.patch
Type: text/x-patch
Size: 4493 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190729/c00b2319/attachment.bin>


More information about the llvm-commits mailing list