Bash and Git Flow bug in common file

423 views Asked by At

I have already installed the Git Flow that seems to be an excellent tool, but when I run the command git flow feature start Test I got the following error:

/usr/lib/git-core/git-flow: 301: export: Internal/WPLion/gitflow/.git: bad variable name

So I tried to find out what's wrong, and I found that inside the file /user/lib/git-core/gitflow-common the script fails to execute the following code:

export DOT_GIT_DIR=$(cd "$DOT_GIT_DIR" && pwd)

that is on line 301.

To debug the script I use the commands echo and exit 1 to break the execution, so the code before the 301 is the following:

DOT_GIT_DIR=$(git rev-parse --git-dir)

so when I use the above command I get the following result on my bash:

.

and when I try to echo anything after the line 301 of course the script breaks.

Also when I try to execute the code git rev-parse --git-dir that it's result is getting saved in the variable DOT_GIT_DIR the result is the following:

/media/merianos/Large Internal/WPLion/gitflow/.git

that is actually the path to git repository inside my project folder.

So, what's wrong with that code? The path spaces maybe making the issue?

1

There are 1 answers

5
KodeFor.Me On

ok, I fixed the issue by my self.

I know that it's not permanent, but I will also try to contribute on the main repository, and fix the bug.

The modification I did, was on file /user/lib/git-core/gitflow-common (Ubuntu system) on lines 301 and 302 and the code was like that:

export DOT_GIT_DIR=$(cd "$DOT_GIT_DIR" && pwd)
export HOOKS_DIR=$(git config --get gitflow.path.hooks || echo "$DOT_GIT_DIR"/hooks) # the second option is used to support previous versions of git-flow

and It became like that:

export DOT_GIT_DIR="$(cd $DOT_GIT_DIR && pwd)"
export HOOKS_DIR="$(git config --get gitflow.path.hooks || echo "$DOT_GIT_DIR"/hooks)" # the second option is used to support previous versions of git-flow