summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xgit-commit.sh2
-rwxr-xr-xgit-send-email.perl3
-rwxr-xr-xgit-stash.sh2
-rwxr-xr-xt/t9500-gitweb-standalone-no-errors.sh18
4 files changed, 17 insertions, 8 deletions
diff --git a/git-commit.sh b/git-commit.sh
index 1d04f1ff31..41538f16e5 100755
--- a/git-commit.sh
+++ b/git-commit.sh
@@ -554,7 +554,7 @@ else
# we need to check if there is anything to commit
run_status >/dev/null
fi
-if [ "$?" != "0" -a ! -f "$GIT_DIR/MERGE_HEAD" -a -z "$amend" ]
+if [ "$?" != "0" -a ! -f "$GIT_DIR/MERGE_HEAD" ]
then
rm -f "$GIT_DIR/COMMIT_EDITMSG" "$GIT_DIR/SQUASH_MSG"
use_status_color=t
diff --git a/git-send-email.perl b/git-send-email.perl
index dd7560b180..d8319d45fb 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -361,7 +361,8 @@ if ($thread && !defined $initial_reply_to && $prompting) {
} while (!defined $_);
$initial_reply_to = $_;
- $initial_reply_to =~ s/(^\s+|\s+$)//g;
+ $initial_reply_to =~ s/^\s+<?/</;
+ $initial_reply_to =~ s/>?\s+$/>/;
}
if (!defined $smtp_server) {
diff --git a/git-stash.sh b/git-stash.sh
index 30425ce6df..7ba61625ba 100755
--- a/git-stash.sh
+++ b/git-stash.sh
@@ -57,7 +57,7 @@ save_stash () {
# state of the index
i_tree=$(git write-tree) &&
- i_commit=$(printf 'index on %s' "$msg" |
+ i_commit=$(printf 'index on %s\n' "$msg" |
git commit-tree $i_tree -p $b_commit) ||
die "Cannot save the current index state"
diff --git a/t/t9500-gitweb-standalone-no-errors.sh b/t/t9500-gitweb-standalone-no-errors.sh
index fa32598b0c..642b836d64 100755
--- a/t/t9500-gitweb-standalone-no-errors.sh
+++ b/t/t9500-gitweb-standalone-no-errors.sh
@@ -58,6 +58,14 @@ gitweb_run () {
# gitweb.log is left for debugging
}
+safe_chmod () {
+ chmod "$1" "$2" &&
+ if [ "$(git config --get core.filemode)" = false ]
+ then
+ git update-index --chmod="$1" "$2"
+ fi
+}
+
. ./test-lib.sh
perl -MEncode -e 'decode_utf8("", Encode::FB_CROAK)' >/dev/null 2>&1 || {
@@ -229,7 +237,7 @@ test_debug 'cat gitweb.log'
test_expect_success \
'commitdiff(0): mode change' \
- 'chmod a+x new_file &&
+ 'safe_chmod +x new_file &&
git commit -a -m "Mode changed." &&
gitweb_run "p=.git;a=commitdiff"'
test_debug 'cat gitweb.log'
@@ -268,7 +276,7 @@ test_debug 'cat gitweb.log'
test_expect_success \
'commitdiff(0): mode change and modified' \
'echo "New line" >> file2 &&
- chmod a+x file2 &&
+ safe_chmod +x file2 &&
git commit -a -m "Mode change and modification." &&
gitweb_run "p=.git;a=commitdiff"'
test_debug 'cat gitweb.log'
@@ -295,7 +303,7 @@ test_expect_success \
'commitdiff(0): renamed, mode change and modified' \
'git mv file3 file2 &&
echo "Propter nomen suum." >> file2 &&
- chmod a+x file2 &&
+ safe_chmod +x file2 &&
git commit -a -m "File rename, mode change and modification." &&
gitweb_run "p=.git;a=commitdiff"'
test_debug 'cat gitweb.log'
@@ -412,10 +420,10 @@ test_expect_success \
git add 03-new &&
git mv 04-rename-from 04-rename-to &&
echo "Changed" >> 04-rename-to &&
- chmod a+x 05-mode-change &&
+ safe_chmod +x 05-mode-change &&
rm -f 06-file-or-symlink && ln -s 01-change 06-file-or-symlink &&
echo "Changed and have mode changed" > 07-change-mode-change &&
- chmod a+x 07-change-mode-change &&
+ safe_chmod +x 07-change-mode-change &&
git commit -a -m "Large commit" &&
git checkout master'