pull: drop confusing prefix parameter of die_on_unclean_work_tree()
commit338bc8d81897d19f4795114e4e6a59d6ca44d1db
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Fri, 7 Oct 2016 16:08:30 +0000 (7 18:08 +0200)
committerJunio C Hamano <gitster@pobox.com>
Fri, 7 Oct 2016 16:29:27 +0000 (7 09:29 -0700)
treed71f01cf6fe52baaf1cdda71e9624ebd937fd567
parentcda1bbd474805e653dda8a71d4ea3790e2a66cbb
pull: drop confusing prefix parameter of die_on_unclean_work_tree()

In cmd_pull(), when verifying that there are no changes preventing a
rebasing pull, we diligently pass the prefix parameter to the
die_on_unclean_work_tree() function which in turn diligently passes it
to the has_unstaged_changes() and has_uncommitted_changes() functions.

The casual reader might now be curious (as this developer was) whether
that means that calling `git pull --rebase` in a subdirectory will
ignore unstaged changes in other parts of the working directory. And be
puzzled that `git pull --rebase` (correctly) complains about those
changes outside of the current directory.

The puzzle is easily resolved: while we take pains to pass around the
prefix and even pass it to init_revisions(), the fact that no paths are
passed to init_revisions() ensures that the prefix is simply ignored.

That, combined with the fact that we will *always* want a *full* working
directory check before running a rebasing pull, is reason enough to
simply do away with the actual prefix parameter and to pass NULL
instead, as if we were running this from the top-level working directory
anyway.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/pull.c