summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 77b96d6)
raw | patch | inline | side by side (parent: 77b96d6)
author | Ben Jackson <ben@ben.com> | |
Sun, 19 Apr 2009 03:42:07 +0000 (20:42 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sun, 19 Apr 2009 04:37:46 +0000 (21:37 -0700) |
Ash (used as /bin/sh on many distros) has a shell expansion bug
for the form ${var:+word word}. The result is a single argument
"word word". Work around by using ${var:+word} ${var:+word} or
equivalent.
Signed-off-by: Ben Jackson <ben@ben.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
for the form ${var:+word word}. The result is a single argument
"word word". Work around by using ${var:+word} ${var:+word} or
equivalent.
Signed-off-by: Ben Jackson <ben@ben.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-am.sh | patch | blob | history | |
git-submodule.sh | patch | blob | history | |
t/t7400-submodule-basic.sh | patch | blob | history |
diff --git a/git-am.sh b/git-am.sh
index 774383fb6893776fcd9454b080b7a8346e6b034d..6d1848b6cce89e4953a3ca6e1b2e6e1611277a4a 100755 (executable)
--- a/git-am.sh
+++ b/git-am.sh
GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE"
export GIT_COMMITTER_DATE
fi &&
- git commit-tree $tree ${parent:+-p $parent} <"$dotest/final-commit"
+ git commit-tree $tree ${parent:+-p} $parent <"$dotest/final-commit"
) &&
git update-ref -m "$GIT_REFLOG_ACTION: $FIRSTLINE" HEAD $commit $parent ||
stop_here $this
diff --git a/git-submodule.sh b/git-submodule.sh
index 7c2e060ae770710ed7ed27d0aed4cfd2e8145810..8e234a4028d22e11baedba11f871d33f56945716 100755 (executable)
--- a/git-submodule.sh
+++ b/git-submodule.sh
else
module_clone "$path" "$realrepo" || exit
- (unset GIT_DIR; cd "$path" && git checkout -f -q ${branch:+-b "$branch" "origin/$branch"}) ||
- die "Unable to checkout submodule '$path'"
+ (
+ unset GIT_DIR
+ cd "$path" &&
+ # ash fails to wordsplit ${branch:+-b "$branch"...}
+ case "$branch" in
+ '') git checkout -f -q ;;
+ ?*) git checkout -f -q -b "$branch" "origin/$branch" ;;
+ esac
+ ) || die "Unable to checkout submodule '$path'"
fi
git add "$path" ||
index af690ec6c1f36871dbd0044d22ab78ab95103541..0f2ccc6cf0123951d9bdbb880931868f29de5b4e 100755 (executable)
)
'
+test_expect_success 'submodule add --branch' '
+ (
+ cd addtest &&
+ git submodule add -b initial "$submodurl" submod-branch &&
+ git submodule init &&
+ cd submod-branch &&
+ git branch | grep initial
+ )
+'
+
test_expect_success 'submodule add with ./ in path' '
(
cd addtest &&