----- Original Message -----
From: Nguyễn Thái Ngọc Duy
Date: 9/21/2011 4:50 AM
if (ce->ce_flags& CE_ADDED&&
verify_absent(ce, ERROR_WOULD_LOSE_UNTRACKED_OVERWRITTEN, o))
- return -1;
+ goto return_failed;
- if (apply_sparse_checkout(ce, o)) {
- ret = -1;
- goto done;
- }
+ if (apply_sparse_checkout(ce, o))
+ goto return_failed;
if (!ce_skip_worktree(ce))
empty_worktree = 0;
Unfortunately, this patch only collects and displays the first untracked
file for me. It does not display all of the files that would be
overwritten (desired behavior, IMHO).
This script illustrates:
#!/bin/sh
rm -Rf utest || exit 1
mkdir utest || exit 1
cd utest || exit 1
git init
git config core.sparseCheckout true
echo *>.git/info/sparse-checkout
echo tracked>a
git add a
git commit -m a a
git branch side
echo tracked>b
echo tracked>c
git add b c
git commit -m bc
cat b
git checkout side
cat b
echo untracked>b
echo untracked>c
cat b
git checkout master
cat b
-Josh
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html