Merge branch 'rn/sparse-describe'
"git describe --dirty" learns to work better with sparse-index. * rn/sparse-describe: describe: enable sparse index for describemaint
commit
7ac228c994
|
@ -658,6 +658,8 @@ int cmd_describe(int argc, const char **argv, const char *prefix)
|
||||||
int fd, result;
|
int fd, result;
|
||||||
|
|
||||||
setup_work_tree();
|
setup_work_tree();
|
||||||
|
prepare_repo_settings(the_repository);
|
||||||
|
the_repository->settings.command_requires_full_index = 0;
|
||||||
repo_read_index(the_repository);
|
repo_read_index(the_repository);
|
||||||
refresh_index(&the_index, REFRESH_QUIET|REFRESH_UNMERGED,
|
refresh_index(&the_index, REFRESH_QUIET|REFRESH_UNMERGED,
|
||||||
NULL, NULL, NULL);
|
NULL, NULL, NULL);
|
||||||
|
|
|
@ -43,6 +43,7 @@ test_expect_success 'setup repo and indexes' '
|
||||||
done &&
|
done &&
|
||||||
|
|
||||||
git sparse-checkout init --cone &&
|
git sparse-checkout init --cone &&
|
||||||
|
git tag -a v1.0 -m "Final" &&
|
||||||
git sparse-checkout set $SPARSE_CONE &&
|
git sparse-checkout set $SPARSE_CONE &&
|
||||||
git checkout -b wide $OLD_COMMIT &&
|
git checkout -b wide $OLD_COMMIT &&
|
||||||
|
|
||||||
|
@ -126,5 +127,7 @@ test_perf_on_all git update-index --add --remove $SPARSE_CONE/a
|
||||||
test_perf_on_all "git rm -f $SPARSE_CONE/a && git checkout HEAD -- $SPARSE_CONE/a"
|
test_perf_on_all "git rm -f $SPARSE_CONE/a && git checkout HEAD -- $SPARSE_CONE/a"
|
||||||
test_perf_on_all git grep --cached bogus -- "f2/f1/f1/*"
|
test_perf_on_all git grep --cached bogus -- "f2/f1/f1/*"
|
||||||
test_perf_on_all git write-tree
|
test_perf_on_all git write-tree
|
||||||
|
test_perf_on_all git describe --dirty
|
||||||
|
test_perf_on_all 'echo >>new && git describe --dirty'
|
||||||
|
|
||||||
test_done
|
test_done
|
||||||
|
|
|
@ -1514,6 +1514,31 @@ test_expect_success 'sparse-index is not expanded: stash' '
|
||||||
ensure_not_expanded stash pop
|
ensure_not_expanded stash pop
|
||||||
'
|
'
|
||||||
|
|
||||||
|
test_expect_success 'describe tested on all' '
|
||||||
|
init_repos &&
|
||||||
|
|
||||||
|
# Add tag to be read by describe
|
||||||
|
|
||||||
|
run_on_all git tag -a v1.0 -m "Version 1" &&
|
||||||
|
test_all_match git describe --dirty &&
|
||||||
|
run_on_all rm g &&
|
||||||
|
test_all_match git describe --dirty
|
||||||
|
'
|
||||||
|
|
||||||
|
|
||||||
|
test_expect_success 'sparse-index is not expanded: describe' '
|
||||||
|
init_repos &&
|
||||||
|
|
||||||
|
# Add tag to be read by describe
|
||||||
|
|
||||||
|
git -C sparse-index tag -a v1.0 -m "Version 1" &&
|
||||||
|
|
||||||
|
ensure_not_expanded describe --dirty &&
|
||||||
|
echo "test" >>sparse-index/g &&
|
||||||
|
ensure_not_expanded describe --dirty &&
|
||||||
|
ensure_not_expanded describe
|
||||||
|
'
|
||||||
|
|
||||||
test_expect_success 'sparse index is not expanded: diff' '
|
test_expect_success 'sparse index is not expanded: diff' '
|
||||||
init_repos &&
|
init_repos &&
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue