Handle Git submodules correctly
authorVictor Vasiliev <vasilvv@mit.edu>
Fri, 11 Oct 2013 02:23:15 +0000 (22:23 -0400)
committerJoey Hess <joey@kitenet.net>
Sun, 27 Oct 2013 16:31:24 +0000 (12:31 -0400)
Due to the way submodules are organized in the latest versions of Git,
the working directory in the submodule repository configuration is set
to the relative path of submodule with respect to its physical GIT_DIR
location, instead of default ".". This confuses git-update-index, and
causes `pristine-tar commit' to fail.

pristine-tar

index 184c657d47f9408a24b9dde7ccc800a2424a5ba9..9005ddb844306a0c093024bbb55cfeb4e356b69d 100755 (executable)
@@ -727,6 +727,7 @@ sub commitdelta {
                # index, and without touching the working tree. Aka deep 
                # git magick.
                $ENV{GIT_INDEX_FILE}="$tempdir/index";
+               $ENV{GIT_WORK_TREE}="$tempdir";
                if (! exists $ENV{GIT_DIR} || ! length $ENV{GIT_DIR}) {         
                        $ENV{GIT_DIR}=getcwd."/.git";
                }