Skip to content

Commit

Permalink
Changed GIT_DIR variable into DOT_GIT_DIR, since Git uses it and chok…
Browse files Browse the repository at this point in the history
…es if

the variable is set explicitly by gitflow.
  • Loading branch information
nvie committed Feb 20, 2010
1 parent 6188206 commit cf6e92a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions git-flow-feature
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ cmd_finish() {
gitflow_require_branch "$BRANCH"

# detect if we're restoring from a merge conflict
if [ -f "$GIT_DIR/.gitflow/MERGE_BASE" ]; then
if [ -f "$DOT_GIT_DIR/.gitflow/MERGE_BASE" ]; then
#
# TODO: detect that we're working on the correct branch here!
# The user need not necessarily have given the same $NAME twice here
Expand All @@ -197,20 +197,20 @@ cmd_finish() {
# exit code for "unmerged changes in working tree", which we should
# actually be testing for here
if gitflow_test_clean_working_tree; then
FINISH_BASE=$(cat "$GIT_DIR/.gitflow/MERGE_BASE")
FINISH_BASE=$(cat "$DOT_GIT_DIR/.gitflow/MERGE_BASE")

# Since the working tree is now clean, either the user did a
# succesfull merge manually, or the merge was cancelled.
# We detect this using gitflow_is_branch_merged_into()
if gitflow_is_branch_merged_into "$BRANCH" "$FINISH_BASE"; then
rm -f "$GIT_DIR/.gitflow/MERGE_BASE"
rm -f "$DOT_GIT_DIR/.gitflow/MERGE_BASE"
helper_finish_cleanup
exit 0
else
# If the user cancelled the merge and decided to wait until later,
# that's fine. But we have to acknowledge this by removing the
# MERGE_BASE file and continuing normal execution of the finish
rm -f "$GIT_DIR/.gitflow/MERGE_BASE"
rm -f "$DOT_GIT_DIR/.gitflow/MERGE_BASE"
fi
else
echo
Expand Down Expand Up @@ -260,8 +260,8 @@ cmd_finish() {
if [ $? -ne 0 ]; then
# oops.. we have a merge conflict!
# write the given $DEVELOP_BRANCH to a temporary file (we need it later)
mkdir -p "$GIT_DIR/.gitflow"
echo "$DEVELOP_BRANCH" > "$GIT_DIR/.gitflow/MERGE_BASE"
mkdir -p "$DOT_GIT_DIR/.gitflow"
echo "$DEVELOP_BRANCH" > "$DOT_GIT_DIR/.gitflow/MERGE_BASE"
echo
echo "There were merge conflicts. To resolve the merge conflict manually, use:"
echo " git mergetool"
Expand Down
2 changes: 1 addition & 1 deletion gitflow-common
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ gitflow_all_tags() { git tag; }

# loading settings that can be overridden using git config
gitflow_load_settings() {
export GIT_DIR=$(git rev-parse --git-dir >/dev/null 2>&1)
export DOT_GIT_DIR=$(git rev-parse --git-dir >/dev/null 2>&1)
export MASTER_BRANCH=$(git config --get gitflow.branch.master || echo master)
export DEVELOP_BRANCH=$(git config --get gitflow.branch.develop || echo develop)
export ORIGIN=$(git config --get gitflow.origin || echo origin)
Expand Down

0 comments on commit cf6e92a

Please sign in to comment.