File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change 178
178
#
179
179
# git-filter-branch ... new-H C..H --not D
180
180
# git-filter-branch ... new-H D..H --not C
181
+ #
182
+ # To move the whole tree into a subdirectory, or remove it from there:
183
+ #
184
+ # git-filter-branch --index-filter \
185
+ # 'git-ls-files -s | sed "s-\t-&newsubdir/-" |
186
+ # GIT_INDEX_FILE=$GIT_INDEX_FILE.new \
187
+ # git-update-index --index-info &&
188
+ # mv $GIT_INDEX_FILE.new $GIT_INDEX_FILE' directorymoved
181
189
182
190
# Testsuite: TODO
183
191
Original file line number Diff line number Diff line change @@ -99,4 +99,12 @@ test_expect_success 'subdirectory filter result looks okay' '
99
99
! git show sub:subdir
100
100
'
101
101
102
+ test_expect_success ' use index-filter to move into a subdirectory' '
103
+ git-filter-branch --index-filter \
104
+ "git-ls-files -s | sed \"s-\\t-&newsubdir/-\" |
105
+ GIT_INDEX_FILE=\$GIT_INDEX_FILE.new \
106
+ git-update-index --index-info &&
107
+ mv \$GIT_INDEX_FILE.new \$GIT_INDEX_FILE" directorymoved &&
108
+ test -z "$(git diff HEAD directorymoved:newsubdir)"'
109
+
102
110
test_done
You can’t perform that action at this time.
0 commit comments