Quote the source directory in Git commands.
authorGuy Harris <guy@alum.mit.edu>
Sun, 22 Nov 2015 19:24:01 +0000 (11:24 -0800)
committerGuy Harris <guy@alum.mit.edu>
Sun, 22 Nov 2015 19:25:48 +0000 (19:25 +0000)
It may contain spaces (it does on my Windows 7 VM), so it must be
quoted.  (There are probably other places where it needs to be quoted in
this script.)

Change-Id: If363691b0f94bbe75755072fd5245266566c3360
Reviewed-on: https://code.wireshark.org/review/12043
Reviewed-by: Guy Harris <guy@alum.mit.edu>
make-version.pl

index 0eee0beabafe54d25c2e6c6ca29bf217286b5533..62312e6c78ecbc16d58a729e17457f770503d824 100755 (executable)
@@ -163,13 +163,13 @@ sub read_repo_info {
                        use warnings "all";
                        no warnings "all";
 
-                       chomp($line = qx{git --git-dir=$srcdir/.git log -1 --pretty=format:%at});
+                       chomp($line = qx{git --git-dir="$srcdir"/.git log -1 --pretty=format:%at});
                        if ($? == 0 && length($line) > 1) {
                                $last_change = $line;
                        }
 
                        # Commits since last annotated tag.
-                       chomp($line = qx{git --git-dir=$srcdir/.git describe --long --always --match "v*"});
+                       chomp($line = qx{git --git-dir="$srcdir"/.git describe --long --always --match "v*"});
                        if ($? == 0 && length($line) > 1) {
                                my @parts = split(/-/, $line);
                                $git_description = $line;
@@ -179,7 +179,7 @@ sub read_repo_info {
 
                        # This will break in some cases. Hopefully not during
                        # official package builds.
-                       chomp($line = qx{git --git-dir=$srcdir/.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 ($? == 0 && length($line) > 1) {
                                $repo_branch = basename($line);
                        }