use the right src dir in git command for svnversion.h
authordidier <dgautheron@magic.fr>
Wed, 5 Feb 2014 16:21:55 +0000 (17:21 +0100)
committerPascal Quantin <pascal.quantin@gmail.com>
Wed, 5 Feb 2014 22:27:16 +0000 (22:27 +0000)
make-version.pl wasn't using the right source dir for git commands when not compiling from inside source tree.
add --git-dir=$srcdir/.git parameter.

Change-Id: I45ca4874d96abaed1c559c022d0ace66239652c8
Reviewed-on: https://code.wireshark.org/review/122
Reviewed-by: Evan Huus <eapache@gmail.com>
Tested-by: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
make-version.pl

index 6b68be4821fa18fceb392cb34216c8be549c7f7e..73d038a612e9be6c1187cc3fabbfb844298436d1 100755 (executable)
@@ -160,30 +160,30 @@ sub read_repo_info {
                        use warnings "all";
                        no warnings "all";
 
-                       chomp($line = qx{git log -1 --pretty=format:%at});
+                       chomp($line = qx{git --git-dir=$srcdir/.git log -1 --pretty=format:%at});
                        if (defined($line)) {
                                $last_change = $line;
                        }
 
                        # Commits in current (master-1.8) branch. We may want to use
                        # a different number.
-                       chomp($line = qx{git rev-list --count ea19c7f952ce9fc53fe4c223f1d9d6797346258b..HEAD});
+                       chomp($line = qx{git --git-dir=$srcdir/.git rev-list --count ea19c7f952ce9fc53fe4c223f1d9d6797346258b..HEAD});
                        if (defined($line)) {
                                $revision = $line;
                        }
 
-                       chomp($line = qx{git ls-remote --get-url origin});
+                       chomp($line = qx{git --git-dir=$srcdir/.git ls-remote --get-url origin});
                        if (defined($line)) {
                                $repo_url = $line;
                        }
 
                        # Probably not quite what we're looking for
-                       chomp($line = qx{git rev-parse --abbrev-ref --symbolic-full-name \@\{upstream\}});
+                       chomp($line = qx{git --git-dir=$srcdir/.git rev-parse --abbrev-ref --symbolic-full-name \@\{upstream\}});
                        if (defined($line)) {
                                $repo_path = basename($line);
                        }
 
-                       chomp($line = qx{git describe --dirty --match "v*"});
+                       chomp($line = qx{git --git-dir=$srcdir/.git describe --dirty --match "v*"});
                        if (defined($line)) {
                                $git_description = "wireshark-" . substr($line, 1);
                        }