]> git.ipfire.org Git - thirdparty/git.git/commit - t/t7400-submodule-basic.sh
submodule deinit: clarify work tree removal message
authorJens Lehmann <Jens.Lehmann@web.de>
Mon, 1 Apr 2013 19:02:00 +0000 (21:02 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 1 Apr 2013 20:05:54 +0000 (13:05 -0700)
commit7b294bf4948931a915cee2d5a692235e9b9c0e27
treef3b480c3ac33ce25575dc87e3b86b29fc7b1cfb8
parentcf419828064d4f22a2c3134e7b46a7719462b1dc
submodule deinit: clarify work tree removal message

The output of "git submodule deinit sub" of a populated submodule prints

  rm 'sub'

as the first line unless used with the -f option.

The "rm 'sub'" line is exactly the same output the user gets when using
"git rm sub" (because that command is used with the --dry-run option under
the hood to determine if the submodule is clean), which can easily lead to
the false impression that the submodule would be permanently removed. Also
users might be confused that the "rm 'submodule'" line won't show up when
the -f option is used, as the test is skipped in this case.

Silence the "rm 'submodule'" output by using the --quiet option for "git
rm" and always print

  Cleared directory 'submodule'

instead as the first output line. This line is printed as long as the
directory exists, no matter if empty or not.

Also extend the tests in t7400 to make sure the "Cleared directory" line
is printed correctly.

Reported-by: Phil Hord <phil.hord@gmail.com>
Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-submodule.sh
t/t7400-submodule-basic.sh