Skip to content

Commit 7a477c9

Browse files
committed
Revert "Merge branch 'ps/validate-prefix-in-subtree-split' into next"
This reverts commit 70c03b7, reversing changes made to faf2e08, as it is reported that subtree tests (in contrib/) are broken by this change. https://lore.kernel.org/git/7k7ewvrb5hj3jyesiigy6dvo5w5pl67rk7ihztsuxbtqpymafv@ey64nvhzhacg/
1 parent 85a36ad commit 7a477c9

2 files changed

Lines changed: 0 additions & 31 deletions

File tree

contrib/subtree/git-subtree.sh

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -257,9 +257,6 @@ main () {
257257
test -e "$arg_prefix" &&
258258
die "fatal: prefix '$arg_prefix' already exists."
259259
;;
260-
split)
261-
# checked later against the commit, not the working tree
262-
;;
263260
*)
264261
test -e "$arg_prefix" ||
265262
die "fatal: '$arg_prefix' does not exist; use 'git subtree add'"
@@ -969,12 +966,6 @@ cmd_split () {
969966
else
970967
die "fatal: you must provide exactly one revision, and optionally a repository. Got: '$*'"
971968
fi
972-
973-
# Now validate prefix against the commit, not the working tree
974-
if ! git ls-tree -d "$rev" -- "$dir" >/dev/null
975-
then
976-
die "fatal: '$dir' does not exist in commit $rev"
977-
fi
978969
repository=""
979970
if test "$#" = 2
980971
then

contrib/subtree/t/t7900-subtree.sh

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -368,28 +368,6 @@ test_expect_success 'split requires path given by option --prefix must exist' '
368368
)
369369
'
370370

371-
test_expect_success 'split works when prefix exists in commit but not in working tree' '
372-
subtree_test_create_repo "$test_count" &&
373-
(
374-
cd "$test_count" &&
375-
376-
# create subtree
377-
mkdir pkg &&
378-
echo ok >pkg/file &&
379-
git add pkg &&
380-
git commit -m "add pkg" &&
381-
good=$(git rev-parse HEAD) &&
382-
383-
# remove it from working tree in later commit
384-
git rm -r pkg &&
385-
git commit -m "remove pkg" &&
386-
387-
# must still be able to split using the old commit
388-
git subtree split --prefix=pkg "$good" >out &&
389-
test -s out
390-
)
391-
'
392-
393371
test_expect_success 'split rejects flags for add' '
394372
subtree_test_create_repo "$test_count" &&
395373
subtree_test_create_repo "$test_count/sub proj" &&

0 commit comments

Comments
 (0)