contrib/diffall: comment actual reason for 'cdup'
The comment from an earlier commit did not reflect the actual reason this operation is needed. Signed-off-by: Tim Henigan <tim.henigan@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Tim Henigan committed
Mar 14, 2012 at 12:38 UTC
a22a9477fcd64a58fafc75d12320cda2c3ce9dbb
1 file changed
+3
-1
contrib/diffall/git-diffall
+3
-1
@@ -36,7 +36,9 @@ fi
36
37
start_dir=$(pwd)
38
39
-# needed to access tar utility
39
+# All the file paths returned by the diff command are relative to the root
40
+# of the working copy. So if the script is called from a subdirectory, it
41
+# must switch to the root of working copy before trying to use those paths.
42
cdup=$(git rev-parse --show-cdup) &&
43
cd "$cdup" || {
44
echo >&2 "Cannot chdir to $cdup, the toplevel of the working tree"