mirror of
https://github.com/git/git.git
synced 2026-03-18 12:40:05 +01:00
Merge branch 'devel' of git://repo.or.cz/git/mingw/4msysgit into devel
This commit is contained in:
4
Documentation/RelNotes/1.7.4.5.txt
Normal file
4
Documentation/RelNotes/1.7.4.5.txt
Normal file
@@ -0,0 +1,4 @@
|
||||
Git v1.7.4.5 Release Notes
|
||||
==========================
|
||||
|
||||
This contains only minor documentation fixes accumulated since 1.7.4.4.
|
||||
@@ -1,4 +1,4 @@
|
||||
Git v1.7.5 Release Notes (draft)
|
||||
Git v1.7.5 Release Notes
|
||||
========================
|
||||
|
||||
Updates since v1.7.4
|
||||
@@ -130,9 +130,3 @@ release, unless otherwise noted.
|
||||
doing both a mirror fetch and a mirror push at the same time, which
|
||||
made little sense. We now warn and require the command line to specify
|
||||
either --mirror=fetch or --mirror=push.
|
||||
|
||||
---
|
||||
exec >/var/tmp/1
|
||||
O=v1.7.5-rc2
|
||||
echo O=$(git describe 'master')
|
||||
git shortlog --no-merges ^maint ^$O master
|
||||
|
||||
@@ -217,6 +217,13 @@ config key: svn.commiturl (overwrites all svn-remote.<name>.commiturl options)
|
||||
Using this option for any other purpose (don't ask) is very strongly
|
||||
discouraged.
|
||||
|
||||
--mergeinfo=<mergeinfo>;;
|
||||
Add the given merge information during the dcommit
|
||||
(e.g. `--mergeinfo="/branches/foo:1-10"`). All svn server versions can
|
||||
store this information (as a property), and svn clients starting from
|
||||
version 1.5 can make use of it. 'git svn' currently does not use it
|
||||
and does not set it automatically.
|
||||
|
||||
'branch'::
|
||||
Create a branch in the SVN repository.
|
||||
|
||||
|
||||
@@ -44,9 +44,15 @@ unreleased) version of git, that is available from 'master'
|
||||
branch of the `git.git` repository.
|
||||
Documentation for older releases are available here:
|
||||
|
||||
* link:v1.7.4.4/git.html[documentation for release 1.7.4.4]
|
||||
* link:v1.7.5/git.html[documentation for release 1.7.5]
|
||||
|
||||
* release notes for
|
||||
link:RelNotes/1.7.5.txt[1.7.5].
|
||||
|
||||
* link:v1.7.4.5/git.html[documentation for release 1.7.4.5]
|
||||
|
||||
* release notes for
|
||||
link:RelNotes/1.7.4.5.txt[1.7.4.5],
|
||||
link:RelNotes/1.7.4.4.txt[1.7.4.4],
|
||||
link:RelNotes/1.7.4.3.txt[1.7.4.3],
|
||||
link:RelNotes/1.7.4.2.txt[1.7.4.2],
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
GVF=GIT-VERSION-FILE
|
||||
DEF_VER=v1.7.5-rc2
|
||||
DEF_VER=v1.7.5
|
||||
|
||||
LF='
|
||||
'
|
||||
|
||||
53
Makefile
53
Makefile
@@ -326,9 +326,7 @@ GCOV = gcov
|
||||
|
||||
export TCL_PATH TCLTK_PATH
|
||||
|
||||
# sparse is architecture-neutral, which means that we need to tell it
|
||||
# explicitly what architecture to check for. Fix this up for yours..
|
||||
SPARSE_FLAGS = -D__BIG_ENDIAN__ -D__powerpc__
|
||||
SPARSE_FLAGS =
|
||||
|
||||
|
||||
|
||||
@@ -532,6 +530,7 @@ LIB_H += list-objects.h
|
||||
LIB_H += ll-merge.h
|
||||
LIB_H += log-tree.h
|
||||
LIB_H += mailmap.h
|
||||
LIB_H += merge-file.h
|
||||
LIB_H += merge-recursive.h
|
||||
LIB_H += notes.h
|
||||
LIB_H += notes-cache.h
|
||||
@@ -929,6 +928,7 @@ ifeq ($(uname_O),Cygwin)
|
||||
X = .exe
|
||||
COMPAT_OBJS += compat/cygwin.o
|
||||
UNRELIABLE_FSTAT = UnfortunatelyYes
|
||||
SPARSE_FLAGS = -isystem /usr/include/w32api -Wno-one-bit-signed-bitfield
|
||||
endif
|
||||
ifeq ($(uname_S),FreeBSD)
|
||||
NEEDS_LIBICONV = YesPlease
|
||||
@@ -1182,6 +1182,7 @@ ifneq (,$(findstring MINGW,$(uname_S)))
|
||||
EXTLIBS += -lws2_32
|
||||
PTHREAD_LIBS =
|
||||
X = .exe
|
||||
SPARSE_FLAGS = -Wno-one-bit-signed-bitfield
|
||||
ifneq (,$(wildcard ../THIS_IS_MSYSGIT))
|
||||
htmldir=doc/git/html/
|
||||
prefix =
|
||||
@@ -1585,6 +1586,7 @@ ifndef V
|
||||
QUIET_LNCP = @echo ' ' LN/CP $@;
|
||||
QUIET_XGETTEXT = @echo ' ' XGETTEXT $@;
|
||||
QUIET_GCOV = @echo ' ' GCOV $@;
|
||||
QUIET_SP = @echo ' ' SP $<;
|
||||
QUIET_SUBDIR0 = +@subdir=
|
||||
QUIET_SUBDIR1 = ;$(NO_SUBDIR) echo ' ' SUBDIR $$subdir; \
|
||||
$(MAKE) $(PRINT_DIR) -C $$subdir
|
||||
@@ -1680,17 +1682,17 @@ strip: $(PROGRAMS) git$X
|
||||
$(STRIP) $(STRIP_OPTS) $(PROGRAMS) git$X
|
||||
|
||||
git.o: common-cmds.h
|
||||
git.s git.o: EXTRA_CPPFLAGS = -DGIT_VERSION='"$(GIT_VERSION)"' \
|
||||
git.sp git.s git.o: EXTRA_CPPFLAGS = -DGIT_VERSION='"$(GIT_VERSION)"' \
|
||||
'-DGIT_HTML_PATH="$(htmldir_SQ)"'
|
||||
|
||||
git$X: git.o $(BUILTIN_OBJS) $(GITLIBS)
|
||||
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ git.o \
|
||||
$(BUILTIN_OBJS) $(ALL_LDFLAGS) $(LIBS)
|
||||
|
||||
help.o: common-cmds.h
|
||||
help.sp help.o: common-cmds.h
|
||||
|
||||
builtin/help.o: common-cmds.h
|
||||
builtin/help.s builtin/help.o: EXTRA_CPPFLAGS = \
|
||||
builtin/help.sp builtin/help.o: common-cmds.h
|
||||
builtin/help.sp builtin/help.s builtin/help.o: EXTRA_CPPFLAGS = \
|
||||
'-DGIT_HTML_PATH="$(htmldir_SQ)"' \
|
||||
'-DGIT_MAN_PATH="$(mandir_SQ)"' \
|
||||
'-DGIT_INFO_PATH="$(infodir_SQ)"'
|
||||
@@ -1978,30 +1980,34 @@ $(VCSSVN_OBJS) $(VCSSVN_TEST_OBJS): $(LIB_H) \
|
||||
test-svn-fe.o: vcs-svn/svndump.h
|
||||
endif
|
||||
|
||||
exec_cmd.s exec_cmd.o: EXTRA_CPPFLAGS = \
|
||||
exec_cmd.sp exec_cmd.s exec_cmd.o: EXTRA_CPPFLAGS = \
|
||||
'-DGIT_EXEC_PATH="$(gitexecdir_SQ)"' \
|
||||
'-DBINDIR="$(bindir_relative_SQ)"' \
|
||||
'-DPREFIX="$(prefix_SQ)"'
|
||||
|
||||
builtin/init-db.s builtin/init-db.o: EXTRA_CPPFLAGS = \
|
||||
builtin/init-db.sp builtin/init-db.s builtin/init-db.o: EXTRA_CPPFLAGS = \
|
||||
-DDEFAULT_GIT_TEMPLATE_DIR='"$(template_dir_SQ)"'
|
||||
|
||||
config.s config.o: EXTRA_CPPFLAGS = -DETC_GITCONFIG='"$(ETC_GITCONFIG_SQ)"'
|
||||
config.sp config.s config.o: EXTRA_CPPFLAGS = \
|
||||
-DETC_GITCONFIG='"$(ETC_GITCONFIG_SQ)"'
|
||||
|
||||
attr.s attr.o: EXTRA_CPPFLAGS = -DETC_GITATTRIBUTES='"$(ETC_GITATTRIBUTES_SQ)"'
|
||||
attr.sp attr.s attr.o: EXTRA_CPPFLAGS = \
|
||||
-DETC_GITATTRIBUTES='"$(ETC_GITATTRIBUTES_SQ)"'
|
||||
|
||||
http.s http.o: EXTRA_CPPFLAGS = -DGIT_HTTP_USER_AGENT='"git/$(GIT_VERSION)"'
|
||||
http.sp http.s http.o: EXTRA_CPPFLAGS = \
|
||||
-DGIT_HTTP_USER_AGENT='"git/$(GIT_VERSION)"'
|
||||
|
||||
ifdef NO_EXPAT
|
||||
http-walker.s http-walker.o: EXTRA_CPPFLAGS = -DNO_EXPAT
|
||||
http-walker.sp http-walker.s http-walker.o: EXTRA_CPPFLAGS = -DNO_EXPAT
|
||||
endif
|
||||
|
||||
ifdef NO_REGEX
|
||||
compat/regex/regex.o: EXTRA_CPPFLAGS = -DGAWK -DNO_MBSUPPORT
|
||||
compat/regex/regex.sp compat/regex/regex.o: EXTRA_CPPFLAGS = \
|
||||
-DGAWK -DNO_MBSUPPORT
|
||||
endif
|
||||
|
||||
ifdef USE_NED_ALLOCATOR
|
||||
compat/nedmalloc/nedmalloc.o: EXTRA_CPPFLAGS = \
|
||||
compat/nedmalloc/nedmalloc.sp compat/nedmalloc/nedmalloc.o: EXTRA_CPPFLAGS = \
|
||||
-DNDEBUG -DOVERRIDE_STRDUP -DREPLACE_SYSTEM_ALLOCATOR
|
||||
endif
|
||||
|
||||
@@ -2167,13 +2173,20 @@ test-%$X: test-%.o $(GITLIBS)
|
||||
check-sha1:: test-sha1$X
|
||||
./test-sha1.sh
|
||||
|
||||
SP_OBJ = $(patsubst %.o,%.sp,$(C_OBJ))
|
||||
|
||||
$(SP_OBJ): %.sp: %.c GIT-CFLAGS FORCE
|
||||
$(QUIET_SP)cgcc -no-compile $(ALL_CFLAGS) $(EXTRA_CPPFLAGS) \
|
||||
$(SPARSE_FLAGS) $<
|
||||
|
||||
.PHONY: sparse $(SP_OBJ)
|
||||
sparse: $(SP_OBJ)
|
||||
|
||||
check: common-cmds.h
|
||||
if sparse; \
|
||||
@if sparse; \
|
||||
then \
|
||||
for i in $(patsubst %.o, %.c, $(GIT_OBJS)); \
|
||||
do \
|
||||
sparse $(ALL_CFLAGS) $(SPARSE_FLAGS) $$i || exit; \
|
||||
done; \
|
||||
echo 2>&1 "Use 'make sparse' instead"; \
|
||||
$(MAKE) --no-print-directory sparse; \
|
||||
else \
|
||||
echo 2>&1 "Did you mean 'make test'?"; \
|
||||
exit 1; \
|
||||
|
||||
4
attr.c
4
attr.c
@@ -465,7 +465,7 @@ static void drop_attr_stack(void)
|
||||
}
|
||||
}
|
||||
|
||||
const char *git_etc_gitattributes(void)
|
||||
static const char *git_etc_gitattributes(void)
|
||||
{
|
||||
static const char *system_wide;
|
||||
if (!system_wide)
|
||||
@@ -473,7 +473,7 @@ const char *git_etc_gitattributes(void)
|
||||
return system_wide;
|
||||
}
|
||||
|
||||
int git_attr_system(void)
|
||||
static int git_attr_system(void)
|
||||
{
|
||||
return !git_env_bool("GIT_ATTR_NOSYSTEM", 0);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "cache.h"
|
||||
#include "builtin.h"
|
||||
#include "delta.h"
|
||||
#include "pack.h"
|
||||
#include "csum-file.h"
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include "xdiff-interface.h"
|
||||
#include "blob.h"
|
||||
#include "exec_cmd.h"
|
||||
#include "merge-file.h"
|
||||
|
||||
static const char merge_tree_usage[] = "git merge-tree <base-tree> <branch1> <branch2>";
|
||||
static int resolve_directories = 1;
|
||||
@@ -54,8 +55,6 @@ static const char *explanation(struct merge_list *entry)
|
||||
return "removed in remote";
|
||||
}
|
||||
|
||||
extern void *merge_file(const char *, struct blob *, struct blob *, struct blob *, unsigned long *);
|
||||
|
||||
static void *result(struct merge_list *entry, unsigned long *size)
|
||||
{
|
||||
enum object_type type;
|
||||
|
||||
@@ -29,9 +29,6 @@ static int compare_by_number(const void *a1, const void *a2)
|
||||
return -1;
|
||||
}
|
||||
|
||||
const char *format_subject(struct strbuf *sb, const char *msg,
|
||||
const char *line_separator);
|
||||
|
||||
static void insert_one_record(struct shortlog *log,
|
||||
const char *author,
|
||||
const char *oneline)
|
||||
|
||||
2
commit.h
2
commit.h
@@ -90,6 +90,8 @@ extern char *logmsg_reencode(const struct commit *commit,
|
||||
extern char *reencode_commit_message(const struct commit *commit,
|
||||
const char **encoding_p);
|
||||
extern void get_commit_format(const char *arg, struct rev_info *);
|
||||
extern const char *format_subject(struct strbuf *sb, const char *msg,
|
||||
const char *line_separator);
|
||||
extern void userformat_find_requirements(const char *fmt, struct userformat_want *w);
|
||||
extern void format_commit_message(const struct commit *commit,
|
||||
const char *format, struct strbuf *sb,
|
||||
|
||||
@@ -49,7 +49,9 @@ GIT_QUIET=
|
||||
say () {
|
||||
if test -z "$GIT_QUIET"
|
||||
then
|
||||
printf '%s\n' "$*"
|
||||
cat <<EOF
|
||||
$*
|
||||
EOF
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
@@ -222,9 +222,11 @@ cmd_add()
|
||||
|
||||
if test -z "$force" && ! git add --dry-run --ignore-missing "$path" > /dev/null 2>&1
|
||||
then
|
||||
echo >&2 "The following path is ignored by one of your .gitignore files:" &&
|
||||
echo >&2 $path &&
|
||||
echo >&2 "Use -f if you really want to add it."
|
||||
cat >&2 <<EOF
|
||||
The following path is ignored by one of your .gitignore files:
|
||||
$path
|
||||
Use -f if you really want to add it.
|
||||
EOF
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -742,12 +744,16 @@ cmd_summary() {
|
||||
done |
|
||||
if test -n "$for_status"; then
|
||||
if [ -n "$files" ]; then
|
||||
echo "# Submodules changed but not updated:"
|
||||
status_msg="# Submodules changed but not updated:"
|
||||
else
|
||||
echo "# Submodule changes to be committed:"
|
||||
status_msg="# Submodule changes to be committed:"
|
||||
fi
|
||||
echo "#"
|
||||
sed -e 's|^|# |' -e 's|^# $|#|'
|
||||
status_sed=$(sed -e 's|^|# |' -e 's|^# $|#|')
|
||||
cat <<EOF
|
||||
$status_msg
|
||||
#
|
||||
$status_sed
|
||||
EOF
|
||||
else
|
||||
cat
|
||||
fi
|
||||
|
||||
@@ -1193,13 +1193,13 @@ static struct store *imap_open_store(struct imap_server_conf *srvc)
|
||||
if (!preauth) {
|
||||
#ifndef NO_OPENSSL
|
||||
if (!srvc->use_ssl && CAP(STARTTLS)) {
|
||||
if (imap_exec(ctx, 0, "STARTTLS") != RESP_OK)
|
||||
if (imap_exec(ctx, NULL, "STARTTLS") != RESP_OK)
|
||||
goto bail;
|
||||
if (ssl_socket_connect(&imap->buf.sock, 1,
|
||||
srvc->ssl_verify))
|
||||
goto bail;
|
||||
/* capabilities may have changed, so get the new capabilities */
|
||||
if (imap_exec(ctx, 0, "CAPABILITY") != RESP_OK)
|
||||
if (imap_exec(ctx, NULL, "CAPABILITY") != RESP_OK)
|
||||
goto bail;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include "xdiff-interface.h"
|
||||
#include "ll-merge.h"
|
||||
#include "blob.h"
|
||||
#include "merge-file.h"
|
||||
|
||||
static int fill_mmfile_blob(mmfile_t *f, struct blob *obj)
|
||||
{
|
||||
|
||||
7
merge-file.h
Normal file
7
merge-file.h
Normal file
@@ -0,0 +1,7 @@
|
||||
#ifndef MERGE_FILE_H
|
||||
#define MERGE_FILE_H
|
||||
|
||||
extern void *merge_file(const char *path, struct blob *base, struct blob *our,
|
||||
struct blob *their, unsigned long *size);
|
||||
|
||||
#endif
|
||||
@@ -157,8 +157,7 @@ test_http_push_nonff() {
|
||||
grep "^ ! \[rejected\][ ]*$BRANCH -> $BRANCH (non-fast-forward)$" output
|
||||
'
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT 'non-fast-forward push shows help message' '
|
||||
grep "To prevent you from losing history, non-fast-forward updates were rejected" \
|
||||
output
|
||||
test_expect_success 'non-fast-forward push shows help message' '
|
||||
test_i18ngrep "To prevent you from losing history, non-fast-forward updates were rejected" output
|
||||
'
|
||||
}
|
||||
|
||||
@@ -180,7 +180,7 @@ test_expect_success 'GIT_DIR & GIT_WORK_TREE (2)' '
|
||||
fi
|
||||
'
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT 'reinit' '
|
||||
test_expect_success 'reinit' '
|
||||
|
||||
(
|
||||
sane_unset GIT_CONFIG GIT_WORK_TREE GIT_CONFIG &&
|
||||
@@ -190,11 +190,11 @@ test_expect_success C_LOCALE_OUTPUT 'reinit' '
|
||||
git init >out1 2>err1 &&
|
||||
git init >out2 2>err2
|
||||
) &&
|
||||
grep "Initialized empty" again/out1 &&
|
||||
grep "Reinitialized existing" again/out2 &&
|
||||
test_i18ngrep "Initialized empty" again/out1 &&
|
||||
test_i18ngrep "Reinitialized existing" again/out2 &&
|
||||
>again/empty &&
|
||||
test_cmp again/empty again/err1 &&
|
||||
test_cmp again/empty again/err2
|
||||
test_i18ncmp again/empty again/err1 &&
|
||||
test_i18ncmp again/empty again/err2
|
||||
'
|
||||
|
||||
test_expect_success 'init with --template' '
|
||||
|
||||
@@ -166,8 +166,8 @@ test_expect_success 'git resolve' '
|
||||
-e "s/^Fast[- ]forward /FASTFORWARD /" >resolve.output
|
||||
'
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT 'git resolve output' '
|
||||
test_cmp resolve.expect resolve.output
|
||||
test_expect_success 'git resolve output' '
|
||||
test_i18ncmp resolve.expect resolve.output
|
||||
'
|
||||
|
||||
cat > show-branch2.expect << EOF
|
||||
|
||||
@@ -29,9 +29,9 @@ test_expect_success 'checkout chooses branch over tag' '
|
||||
test_cmp expect file
|
||||
'
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT 'checkout reports switch to branch' '
|
||||
grep "Switched to branch" stderr &&
|
||||
! grep "^HEAD is now at" stderr
|
||||
test_expect_success 'checkout reports switch to branch' '
|
||||
test_i18ngrep "Switched to branch" stderr &&
|
||||
test_i18ngrep ! "^HEAD is now at" stderr
|
||||
'
|
||||
|
||||
test_expect_success 'checkout vague ref succeeds' '
|
||||
@@ -51,9 +51,9 @@ test_expect_success VAGUENESS_SUCCESS 'checkout chooses branch over tag' '
|
||||
test_cmp expect file
|
||||
'
|
||||
|
||||
test_expect_success VAGUENESS_SUCCESS,C_LOCALE_OUTPUT 'checkout reports switch to branch' '
|
||||
grep "Switched to branch" stderr &&
|
||||
! grep "^HEAD is now at" stderr
|
||||
test_expect_success VAGUENESS_SUCCESS 'checkout reports switch to branch' '
|
||||
test_i18ngrep "Switched to branch" stderr &&
|
||||
test_i18ngrep ! "^HEAD is now at" stderr
|
||||
'
|
||||
|
||||
test_done
|
||||
|
||||
@@ -13,10 +13,10 @@ check_not_detached () {
|
||||
|
||||
ORPHAN_WARNING='you are leaving .* commit.*behind'
|
||||
check_orphan_warning() {
|
||||
grep "$ORPHAN_WARNING" "$1"
|
||||
test_i18ngrep "$ORPHAN_WARNING" "$1"
|
||||
}
|
||||
check_no_orphan_warning() {
|
||||
! grep "$ORPHAN_WARNING" "$1"
|
||||
test_i18ngrep ! "$ORPHAN_WARNING" "$1"
|
||||
}
|
||||
|
||||
reset () {
|
||||
@@ -111,7 +111,7 @@ test_expect_success 'checkout warns on orphan commits' '
|
||||
git checkout master 2>stderr
|
||||
'
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT 'checkout warns on orphan commits: output' '
|
||||
test_expect_success 'checkout warns on orphan commits: output' '
|
||||
check_orphan_warning stderr
|
||||
'
|
||||
|
||||
@@ -121,7 +121,7 @@ test_expect_success 'checkout does not warn leaving ref tip' '
|
||||
git checkout master 2>stderr
|
||||
'
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT 'checkout does not warn leaving ref tip' '
|
||||
test_expect_success 'checkout does not warn leaving ref tip' '
|
||||
check_no_orphan_warning stderr
|
||||
'
|
||||
|
||||
@@ -131,7 +131,7 @@ test_expect_success 'checkout does not warn leaving reachable commit' '
|
||||
git checkout master 2>stderr
|
||||
'
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT 'checkout does not warn leaving reachable commit' '
|
||||
test_expect_success 'checkout does not warn leaving reachable commit' '
|
||||
check_no_orphan_warning stderr
|
||||
'
|
||||
|
||||
|
||||
@@ -111,7 +111,7 @@ test_expect_success 'touch and then add explicitly' '
|
||||
|
||||
'
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT 'add -n -u should not add but just report' '
|
||||
test_expect_success 'add -n -u should not add but just report' '
|
||||
|
||||
(
|
||||
echo "add '\''check'\''" &&
|
||||
@@ -124,7 +124,7 @@ test_expect_success C_LOCALE_OUTPUT 'add -n -u should not add but just report' '
|
||||
after=$(git ls-files -s check top) &&
|
||||
|
||||
test "$before" = "$after" &&
|
||||
test_cmp expect actual
|
||||
test_i18ncmp expect actual
|
||||
|
||||
'
|
||||
|
||||
|
||||
@@ -34,8 +34,8 @@ do
|
||||
! test -s out
|
||||
'
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT "complaints for ignored $i output" '
|
||||
grep -e "Use -f if" err
|
||||
test_expect_success "complaints for ignored $i output" '
|
||||
test_i18ngrep -e "Use -f if" err
|
||||
'
|
||||
|
||||
test_expect_success "complaints for ignored $i with unignored file" '
|
||||
@@ -44,8 +44,8 @@ do
|
||||
git ls-files "$i" >out &&
|
||||
! test -s out
|
||||
'
|
||||
test_expect_success C_LOCALE_OUTPUT "complaints for ignored $i with unignored file output" '
|
||||
grep -e "Use -f if" err
|
||||
test_expect_success "complaints for ignored $i with unignored file output" '
|
||||
test_i18ngrep -e "Use -f if" err
|
||||
'
|
||||
done
|
||||
|
||||
@@ -61,10 +61,10 @@ do
|
||||
)
|
||||
'
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT "complaints for ignored $i in dir output" '
|
||||
test_expect_success "complaints for ignored $i in dir output" '
|
||||
(
|
||||
cd dir &&
|
||||
grep -e "Use -f if" err
|
||||
test_i18ngrep -e "Use -f if" err
|
||||
)
|
||||
'
|
||||
done
|
||||
@@ -81,10 +81,10 @@ do
|
||||
)
|
||||
'
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT "complaints for ignored $i in sub output" '
|
||||
test_expect_success "complaints for ignored $i in sub output" '
|
||||
(
|
||||
cd sub &&
|
||||
grep -e "Use -f if" err
|
||||
test_i18ngrep -e "Use -f if" err
|
||||
)
|
||||
'
|
||||
done
|
||||
|
||||
@@ -313,20 +313,20 @@ test_expect_success 'merge-recursive result' '
|
||||
|
||||
'
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT 'fail if the index has unresolved entries' '
|
||||
test_expect_success 'fail if the index has unresolved entries' '
|
||||
|
||||
rm -fr [abcd] &&
|
||||
git checkout -f "$c1" &&
|
||||
|
||||
test_must_fail git merge "$c5" &&
|
||||
test_must_fail git merge "$c5" 2> out &&
|
||||
grep "not possible because you have unmerged files" out &&
|
||||
test_i18ngrep "not possible because you have unmerged files" out &&
|
||||
git add -u &&
|
||||
test_must_fail git merge "$c5" 2> out &&
|
||||
grep "You have not concluded your merge" out &&
|
||||
test_i18ngrep "You have not concluded your merge" out &&
|
||||
rm -f .git/MERGE_HEAD &&
|
||||
test_must_fail git merge "$c5" 2> out &&
|
||||
grep "Your local changes to the following files would be overwritten by merge:" out
|
||||
test_i18ngrep "Your local changes to the following files would be overwritten by merge:" out
|
||||
'
|
||||
|
||||
test_expect_success 'merge-recursive remove conflict' '
|
||||
|
||||
@@ -4,14 +4,14 @@ test_description='ls-tree with(out) wildcards'
|
||||
|
||||
. ./test-lib.sh
|
||||
|
||||
test_expect_success 'setup' '
|
||||
test_expect_success NOT_MINGW 'setup' '
|
||||
mkdir a aa "a*" &&
|
||||
touch a/one aa/two "a*/three" &&
|
||||
git add a/one aa/two "a*/three" &&
|
||||
git commit -m test
|
||||
'
|
||||
|
||||
test_expect_success 'ls-tree a* matches literally' '
|
||||
test_expect_success NOT_MINGW 'ls-tree a* matches literally' '
|
||||
cat >expected <<EOF &&
|
||||
100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 a*/three
|
||||
EOF
|
||||
|
||||
@@ -203,10 +203,12 @@ test_expect_success 'test deleting branch deletes branch config' \
|
||||
test -z "$(git config branch.my7.remote)" &&
|
||||
test -z "$(git config branch.my7.merge)"'
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT 'test deleting branch without config' \
|
||||
test_expect_success 'test deleting branch without config' \
|
||||
'git branch my7 s &&
|
||||
sha1=$(git rev-parse my7 | cut -c 1-7) &&
|
||||
test "$(git branch -d my7 2>&1)" = "Deleted branch my7 (was $sha1)."'
|
||||
echo "Deleted branch my7 (was $sha1)." >expect &&
|
||||
git branch -d my7 >actual 2>&1 &&
|
||||
test_i18ncmp expect actual'
|
||||
|
||||
test_expect_success 'test --track without .fetch entries' \
|
||||
'git branch --track my8 &&
|
||||
|
||||
@@ -72,10 +72,10 @@ cat >expect <<'EOF'
|
||||
branch-two
|
||||
master
|
||||
EOF
|
||||
test_expect_success C_LOCALE_OUTPUT 'git branch shows detached HEAD properly' '
|
||||
test_expect_success 'git branch shows detached HEAD properly' '
|
||||
git checkout HEAD^0 &&
|
||||
git branch >actual &&
|
||||
test_cmp expect actual
|
||||
test_i18ncmp expect actual
|
||||
'
|
||||
|
||||
test_done
|
||||
|
||||
@@ -91,12 +91,12 @@ test_expect_success 'cherry-pick on stat-dirty working tree' '
|
||||
)
|
||||
'
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT 'revert forbidden on dirty working tree' '
|
||||
test_expect_success 'revert forbidden on dirty working tree' '
|
||||
|
||||
echo content >extra_file &&
|
||||
git add extra_file &&
|
||||
test_must_fail git revert HEAD 2>errors &&
|
||||
grep "Your local changes would be overwritten by " errors
|
||||
test_i18ngrep "Your local changes would be overwritten by " errors
|
||||
|
||||
'
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ test_expect_success 'failed cherry-pick does not advance HEAD' '
|
||||
test "$head" = "$newhead"
|
||||
'
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT 'advice from failed cherry-pick' "
|
||||
test_expect_success 'advice from failed cherry-pick' "
|
||||
pristine_detach initial &&
|
||||
|
||||
picked=\$(git rev-parse --short picked) &&
|
||||
@@ -56,7 +56,7 @@ test_expect_success C_LOCALE_OUTPUT 'advice from failed cherry-pick' "
|
||||
EOF
|
||||
test_must_fail git cherry-pick picked 2>actual &&
|
||||
|
||||
test_cmp expected actual
|
||||
test_i18ncmp expected actual
|
||||
"
|
||||
|
||||
test_expect_success 'failed cherry-pick sets CHERRY_PICK_HEAD' '
|
||||
|
||||
@@ -271,9 +271,9 @@ test_expect_success 'git add --dry-run of non-existing file' "
|
||||
test_must_fail git add --dry-run track-this ignored-file >actual 2>&1
|
||||
"
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT 'git add --dry-run of an existing file output' "
|
||||
test_expect_success 'git add --dry-run of an existing file output' "
|
||||
echo \"fatal: pathspec 'ignored-file' did not match any files\" >expect &&
|
||||
test_cmp expect actual
|
||||
test_i18ncmp expect actual
|
||||
"
|
||||
|
||||
cat >expect.err <<\EOF
|
||||
@@ -290,9 +290,9 @@ test_expect_success 'git add --dry-run --ignore-missing of non-existing file' '
|
||||
test_must_fail git add --dry-run --ignore-missing track-this ignored-file >actual.out 2>actual.err
|
||||
'
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT 'git add --dry-run --ignore-missing of non-existing file output' '
|
||||
test_cmp expect.out actual.out &&
|
||||
test_cmp expect.err actual.err
|
||||
test_expect_success 'git add --dry-run --ignore-missing of non-existing file output' '
|
||||
test_i18ncmp expect.out actual.out &&
|
||||
test_i18ncmp expect.err actual.err
|
||||
'
|
||||
|
||||
test_done
|
||||
|
||||
@@ -64,18 +64,18 @@ test_expect_success \
|
||||
'validate the output.' \
|
||||
'compare_diff_patch current expected'
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT 'favour same basenames over different ones' '
|
||||
test_expect_success 'favour same basenames over different ones' '
|
||||
cp path1 another-path &&
|
||||
git add another-path &&
|
||||
git commit -m 1 &&
|
||||
git rm path1 &&
|
||||
mkdir subdir &&
|
||||
git mv another-path subdir/path1 &&
|
||||
git status | grep "renamed: .*path1 -> subdir/path1"'
|
||||
git status | test_i18ngrep "renamed: .*path1 -> subdir/path1"'
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT 'favour same basenames even with minor differences' '
|
||||
test_expect_success 'favour same basenames even with minor differences' '
|
||||
git show HEAD:path1 | sed "s/15/16/" > subdir/path1 &&
|
||||
git status | grep "renamed: .*path1 -> subdir/path1"'
|
||||
git status | test_i18ngrep "renamed: .*path1 -> subdir/path1"'
|
||||
|
||||
test_expect_success 'setup for many rename source candidates' '
|
||||
git reset --hard &&
|
||||
|
||||
@@ -614,13 +614,13 @@ echo "fatal: --name-only does not make sense" > expect.name-only
|
||||
echo "fatal: --name-status does not make sense" > expect.name-status
|
||||
echo "fatal: --check does not make sense" > expect.check
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT 'options no longer allowed for format-patch' '
|
||||
test_expect_success 'options no longer allowed for format-patch' '
|
||||
test_must_fail git format-patch --name-only 2> output &&
|
||||
test_cmp expect.name-only output &&
|
||||
test_i18ncmp expect.name-only output &&
|
||||
test_must_fail git format-patch --name-status 2> output &&
|
||||
test_cmp expect.name-status output &&
|
||||
test_i18ncmp expect.name-status output &&
|
||||
test_must_fail git format-patch --check 2> output &&
|
||||
test_cmp expect.check output'
|
||||
test_i18ncmp expect.check output'
|
||||
|
||||
test_expect_success 'format-patch --numstat should produce a patch' '
|
||||
git format-patch --numstat --stdout master..side > output &&
|
||||
|
||||
@@ -20,9 +20,13 @@ test_expect_success 'setup' '
|
||||
mkdir .git/hooks
|
||||
|
||||
cat >.git/hooks/post-rewrite <<EOF
|
||||
#!/bin/sh
|
||||
echo \$@ > "$TRASH_DIRECTORY"/post-rewrite.args
|
||||
cat > "$TRASH_DIRECTORY"/post-rewrite.data
|
||||
#!/usr/bin/perl
|
||||
open (AR, ">$TRASH_DIRECTORY/post-rewrite.args");
|
||||
print AR \$_,"\n" foreach @ARGV;
|
||||
open (DAT, ">$TRASH_DIRECTORY/post-rewrite.data");
|
||||
while(<STDIN>) {
|
||||
print DAT;
|
||||
}
|
||||
EOF
|
||||
chmod u+x .git/hooks/post-rewrite
|
||||
|
||||
|
||||
@@ -135,8 +135,8 @@ test_expect_success 'push fails for non-fast-forward refs unmatched by remote he
|
||||
grep "^ ! \[rejected\] *master -> retsam (non-fast-forward)$" output
|
||||
'
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT 'push fails for non-fast-forward refs unmatched by remote helper: our output' '
|
||||
grep "To prevent you from losing history, non-fast-forward updates were rejected" \
|
||||
test_expect_success 'push fails for non-fast-forward refs unmatched by remote helper: our output' '
|
||||
test_i18ngrep "To prevent you from losing history, non-fast-forward updates were rejected" \
|
||||
output
|
||||
'
|
||||
|
||||
|
||||
@@ -197,7 +197,7 @@ test_expect_success 'clone separate gitdir' '
|
||||
test -d realgitdir/refs
|
||||
'
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT 'clone separate gitdir: output' '
|
||||
test_expect_success 'clone separate gitdir: output' '
|
||||
echo "gitdir: `pwd`/realgitdir" >expected &&
|
||||
test_cmp expected dst/.git
|
||||
'
|
||||
|
||||
@@ -42,13 +42,13 @@ b3 behind 1
|
||||
b4 ahead 2
|
||||
EOF
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT 'branch -v' '
|
||||
test_expect_success 'branch -v' '
|
||||
(
|
||||
cd test &&
|
||||
git branch -v
|
||||
) |
|
||||
sed -n -e "$script" >actual &&
|
||||
test_cmp expect actual
|
||||
test_i18ncmp expect actual
|
||||
'
|
||||
|
||||
test_expect_success 'checkout' '
|
||||
|
||||
@@ -123,8 +123,8 @@ cat - >err.expect <<EOF
|
||||
warning: tag 'A' is really 'Q' here
|
||||
EOF
|
||||
check_describe A-* HEAD
|
||||
test_expect_success C_LOCALE_OUTPUT 'warning was displayed for Q' '
|
||||
test_cmp err.expect err.actual
|
||||
test_expect_success 'warning was displayed for Q' '
|
||||
test_i18ncmp err.expect err.actual
|
||||
'
|
||||
test_expect_success 'rename tag Q back to A' '
|
||||
mv .git/refs/tags/Q .git/refs/tags/A
|
||||
|
||||
@@ -1120,13 +1120,11 @@ test_expect_success \
|
||||
! (GIT_EDITOR=cat git tag -a initial-comment > actual)
|
||||
'
|
||||
|
||||
test_expect_success \
|
||||
C_LOCALE_OUTPUT \
|
||||
'message in editor has initial comment: first line' '
|
||||
test_expect_success 'message in editor has initial comment: first line' '
|
||||
# check the first line --- should be empty
|
||||
echo >first.expect &&
|
||||
sed -e 1q <actual >first.actual &&
|
||||
test_cmp first.expect first.actual
|
||||
test_i18ncmp first.expect first.actual
|
||||
'
|
||||
|
||||
test_expect_success \
|
||||
|
||||
@@ -124,16 +124,16 @@ cat >expected <<EOF
|
||||
Would remove expected
|
||||
Would remove result
|
||||
EOF
|
||||
test_expect_success C_LOCALE_OUTPUT 'git-clean, absent case' '
|
||||
test_expect_success 'git-clean, absent case' '
|
||||
setup_absent &&
|
||||
git clean -n > result &&
|
||||
test_cmp expected result
|
||||
test_i18ncmp expected result
|
||||
'
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT 'git-clean, dirty case' '
|
||||
test_expect_success 'git-clean, dirty case' '
|
||||
setup_dirty &&
|
||||
git clean -n > result &&
|
||||
test_cmp expected result
|
||||
test_i18ncmp expected result
|
||||
'
|
||||
|
||||
#TODO test_expect_failure 'git-apply adds file' false
|
||||
|
||||
@@ -38,7 +38,7 @@ cat >expect <<EOF
|
||||
no changes added to commit (use "git add" and/or "git commit -a")
|
||||
EOF
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT 'M/D conflict does not segfault' '
|
||||
test_expect_success 'M/D conflict does not segfault' '
|
||||
mkdir mdconflict &&
|
||||
(
|
||||
cd mdconflict &&
|
||||
@@ -50,9 +50,9 @@ test_expect_success C_LOCALE_OUTPUT 'M/D conflict does not segfault' '
|
||||
git commit -m delete &&
|
||||
test_must_fail git merge master &&
|
||||
test_must_fail git commit --dry-run >../actual &&
|
||||
test_cmp ../expect ../actual &&
|
||||
test_i18ncmp ../expect ../actual &&
|
||||
git status >../actual &&
|
||||
test_cmp ../expect ../actual
|
||||
test_i18ncmp ../expect ../actual
|
||||
)
|
||||
'
|
||||
|
||||
|
||||
@@ -423,10 +423,10 @@ Unstaged changes after reset:
|
||||
M file2
|
||||
EOF
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT '--mixed refreshes the index' '
|
||||
test_expect_success '--mixed refreshes the index' '
|
||||
echo 123 >> file2 &&
|
||||
git reset --mixed HEAD > output &&
|
||||
test_cmp expect output
|
||||
test_i18ncmp expect output
|
||||
'
|
||||
|
||||
test_expect_success 'disambiguation (1)' '
|
||||
|
||||
@@ -233,11 +233,11 @@ test_expect_success '"reset --merge HEAD^" is ok with pending merge' '
|
||||
# working index HEAD target working index HEAD
|
||||
# ----------------------------------------------------
|
||||
# file1: X U B C --keep (disallowed)
|
||||
test_expect_success C_LOCALE_OUTPUT '"reset --keep HEAD^" fails with pending merge' '
|
||||
test_expect_success '"reset --keep HEAD^" fails with pending merge' '
|
||||
git reset --hard third &&
|
||||
test_must_fail git merge branch1 &&
|
||||
test_must_fail git reset --keep HEAD^ 2>err.log &&
|
||||
grep "middle of a merge" err.log
|
||||
test_i18ngrep "middle of a merge" err.log
|
||||
'
|
||||
|
||||
# The next test will test the following:
|
||||
@@ -259,11 +259,11 @@ test_expect_success '"reset --merge HEAD" is ok with pending merge' '
|
||||
# working index HEAD target working index HEAD
|
||||
# ----------------------------------------------------
|
||||
# file1: X U B B --keep (disallowed)
|
||||
test_expect_success C_LOCALE_OUTPUT '"reset --keep HEAD" fails with pending merge' '
|
||||
test_expect_success '"reset --keep HEAD" fails with pending merge' '
|
||||
git reset --hard third &&
|
||||
test_must_fail git merge branch1 &&
|
||||
test_must_fail git reset --keep HEAD 2>err.log &&
|
||||
grep "middle of a merge" err.log
|
||||
test_i18ngrep "middle of a merge" err.log
|
||||
'
|
||||
|
||||
test_expect_success '--merge is ok with added/deleted merge' '
|
||||
@@ -280,7 +280,7 @@ test_expect_success '--merge is ok with added/deleted merge' '
|
||||
git diff --exit-code --cached
|
||||
'
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT '--keep fails with added/deleted merge' '
|
||||
test_expect_success '--keep fails with added/deleted merge' '
|
||||
git reset --hard third &&
|
||||
rm -f file2 &&
|
||||
test_must_fail git merge branch3 &&
|
||||
@@ -289,7 +289,7 @@ test_expect_success C_LOCALE_OUTPUT '--keep fails with added/deleted merge' '
|
||||
git diff --exit-code file3 &&
|
||||
git diff --exit-code branch3 file3 &&
|
||||
test_must_fail git reset --keep HEAD 2>err.log &&
|
||||
grep "middle of a merge" err.log
|
||||
test_i18ngrep "middle of a merge" err.log
|
||||
'
|
||||
|
||||
test_done
|
||||
|
||||
@@ -223,12 +223,12 @@ test_expect_success 'checkout --merge --conflict=diff3 <branch>' '
|
||||
test_cmp two expect
|
||||
'
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT 'checkout to detach HEAD (with advice declined)' '
|
||||
test_expect_success 'checkout to detach HEAD (with advice declined)' '
|
||||
|
||||
git config advice.detachedHead false &&
|
||||
git checkout -f renamer && git clean -f &&
|
||||
git checkout renamer^ 2>messages &&
|
||||
grep "HEAD is now at 7329388" messages &&
|
||||
test_i18ngrep "HEAD is now at 7329388" messages &&
|
||||
test 1 -eq $(wc -l <messages) &&
|
||||
H=$(git rev-parse --verify HEAD) &&
|
||||
M=$(git show-ref -s --verify refs/heads/master) &&
|
||||
@@ -242,11 +242,11 @@ test_expect_success C_LOCALE_OUTPUT 'checkout to detach HEAD (with advice declin
|
||||
fi
|
||||
'
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT 'checkout to detach HEAD' '
|
||||
test_expect_success 'checkout to detach HEAD' '
|
||||
git config advice.detachedHead true &&
|
||||
git checkout -f renamer && git clean -f &&
|
||||
git checkout renamer^ 2>messages &&
|
||||
grep "HEAD is now at 7329388" messages &&
|
||||
test_i18ngrep "HEAD is now at 7329388" messages &&
|
||||
test 1 -lt $(wc -l <messages) &&
|
||||
H=$(git rev-parse --verify HEAD) &&
|
||||
M=$(git show-ref -s --verify refs/heads/master) &&
|
||||
@@ -260,7 +260,7 @@ test_expect_success C_LOCALE_OUTPUT 'checkout to detach HEAD' '
|
||||
fi
|
||||
'
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT 'checkout to detach HEAD with branchname^' '
|
||||
test_expect_success 'checkout to detach HEAD with branchname^' '
|
||||
|
||||
git checkout -f master && git clean -f &&
|
||||
git checkout renamer^ &&
|
||||
@@ -276,7 +276,7 @@ test_expect_success C_LOCALE_OUTPUT 'checkout to detach HEAD with branchname^' '
|
||||
fi
|
||||
'
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT 'checkout to detach HEAD with :/message' '
|
||||
test_expect_success 'checkout to detach HEAD with :/message' '
|
||||
|
||||
git checkout -f master && git clean -f &&
|
||||
git checkout ":/Initial" &&
|
||||
@@ -292,7 +292,7 @@ test_expect_success C_LOCALE_OUTPUT 'checkout to detach HEAD with :/message' '
|
||||
fi
|
||||
'
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT 'checkout to detach HEAD with HEAD^0' '
|
||||
test_expect_success 'checkout to detach HEAD with HEAD^0' '
|
||||
|
||||
git checkout -f master && git clean -f &&
|
||||
git checkout HEAD^0 &&
|
||||
|
||||
@@ -228,10 +228,6 @@ EOF
|
||||
|
||||
test_expect_success '--for-status' "
|
||||
git submodule summary --for-status HEAD^ >actual &&
|
||||
if test_have_prereq MINGW
|
||||
then
|
||||
dos2unix actual
|
||||
fi &&
|
||||
test_cmp actual - <<EOF
|
||||
# Submodule changes to be committed:
|
||||
#
|
||||
|
||||
@@ -15,7 +15,7 @@ commit_msg_is () {
|
||||
|
||||
printf "%s" "$(git log --pretty=format:%s%b -1)" >$expect &&
|
||||
printf "%s" "$1" >$actual &&
|
||||
test_cmp $expect $actual
|
||||
test_i18ncmp $expect $actual
|
||||
}
|
||||
|
||||
# A sanity check to see if commit is working at all.
|
||||
@@ -72,7 +72,7 @@ test_expect_success 'adding comments to a template should not commit' '
|
||||
)
|
||||
'
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT 'adding real content to a template should commit' '
|
||||
test_expect_success 'adding real content to a template should commit' '
|
||||
(
|
||||
test_set_editor "$TEST_DIRECTORY"/t7500/add-content &&
|
||||
git commit --template "$TEMPLATE"
|
||||
@@ -80,7 +80,7 @@ test_expect_success C_LOCALE_OUTPUT 'adding real content to a template should co
|
||||
commit_msg_is "template linecommit message"
|
||||
'
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT '-t option should be short for --template' '
|
||||
test_expect_success '-t option should be short for --template' '
|
||||
echo "short template" > "$TEMPLATE" &&
|
||||
echo "new content" >> foo &&
|
||||
git add foo &&
|
||||
@@ -91,7 +91,7 @@ test_expect_success C_LOCALE_OUTPUT '-t option should be short for --template' '
|
||||
commit_msg_is "short templatecommit message"
|
||||
'
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT 'config-specified template should commit' '
|
||||
test_expect_success 'config-specified template should commit' '
|
||||
echo "new template" > "$TEMPLATE" &&
|
||||
git config commit.template "$TEMPLATE" &&
|
||||
echo "more content" >> foo &&
|
||||
@@ -290,7 +290,7 @@ test_expect_success 'commit --squash works with -c for same commit' '
|
||||
commit_msg_is "squash! edited commit"
|
||||
'
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT 'commit --squash works with editor' '
|
||||
test_expect_success 'commit --squash works with editor' '
|
||||
commit_for_rebase_autosquash_setup &&
|
||||
test_set_editor "$TEST_DIRECTORY"/t7500/add-content &&
|
||||
git commit --squash HEAD~1 &&
|
||||
|
||||
@@ -16,9 +16,10 @@ test_expect_success \
|
||||
"echo 'bongo bongo' >file &&
|
||||
git add file"
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT \
|
||||
"Constructing initial commit" \
|
||||
"git status | grep 'Initial commit'"
|
||||
test_expect_success "Constructing initial commit" '
|
||||
git status >actual &&
|
||||
test_i18ngrep "Initial commit" actual
|
||||
'
|
||||
|
||||
test_expect_success \
|
||||
"fail initial amend" \
|
||||
|
||||
@@ -22,10 +22,7 @@ check_summary_oneline() {
|
||||
SUMMARY_POSTFIX="$(git log -1 --pretty='format:%h')"
|
||||
echo "[$SUMMARY_PREFIX $SUMMARY_POSTFIX] $2" >exp &&
|
||||
|
||||
if test_have_prereq C_LOCALE_OUTPUT
|
||||
then
|
||||
test_cmp exp act
|
||||
fi
|
||||
test_i18ncmp exp act
|
||||
}
|
||||
|
||||
test_expect_success 'output summary format' '
|
||||
@@ -234,23 +231,19 @@ echo "sample
|
||||
# Please enter the commit message for your changes. Lines starting
|
||||
# with '#' will be ignored, and an empty message aborts the commit." >expect
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT 'cleanup commit messages (strip,-F,-e): output' '
|
||||
test_cmp expect actual
|
||||
test_expect_success 'cleanup commit messages (strip,-F,-e): output' '
|
||||
test_i18ncmp expect actual
|
||||
'
|
||||
|
||||
echo "#
|
||||
# Author: $GIT_AUTHOR_NAME <$GIT_AUTHOR_EMAIL>
|
||||
#" >> expect
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT 'author different from committer' '
|
||||
|
||||
test_expect_success 'author different from committer' '
|
||||
echo >>negative &&
|
||||
git commit -e -m "sample"
|
||||
head -n 7 .git/COMMIT_EDITMSG >actual
|
||||
'
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT 'author different from committer: output' '
|
||||
test_cmp expect actual
|
||||
test_might_fail git commit -e -m "sample" &&
|
||||
head -n 7 .git/COMMIT_EDITMSG >actual &&
|
||||
test_i18ncmp expect actual
|
||||
'
|
||||
|
||||
mv expect expect.tmp
|
||||
@@ -259,7 +252,7 @@ rm -f expect.tmp
|
||||
echo "# Committer:
|
||||
#" >> expect
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT 'committer is automatic' '
|
||||
test_expect_success 'committer is automatic' '
|
||||
|
||||
echo >>negative &&
|
||||
(
|
||||
@@ -270,10 +263,7 @@ test_expect_success C_LOCALE_OUTPUT 'committer is automatic' '
|
||||
) &&
|
||||
head -n 8 .git/COMMIT_EDITMSG | \
|
||||
sed "s/^# Committer: .*/# Committer:/" >actual
|
||||
'
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT 'committer is automatic: output' '
|
||||
test_cmp expect actual
|
||||
test_i18ncmp expect actual
|
||||
'
|
||||
|
||||
pwd=`pwd`
|
||||
@@ -376,78 +366,78 @@ try_commit () {
|
||||
GIT_EDITOR=.git/FAKE_EDITOR git commit -a $* $use_template &&
|
||||
case "$use_template" in
|
||||
'')
|
||||
! grep "^## Custom template" .git/COMMIT_EDITMSG ;;
|
||||
test_i18ngrep ! "^## Custom template" .git/COMMIT_EDITMSG ;;
|
||||
*)
|
||||
grep "^## Custom template" .git/COMMIT_EDITMSG ;;
|
||||
test_i18ngrep "^## Custom template" .git/COMMIT_EDITMSG ;;
|
||||
esac
|
||||
}
|
||||
|
||||
try_commit_status_combo () {
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT 'commit' '
|
||||
test_expect_success 'commit' '
|
||||
clear_config commit.status &&
|
||||
try_commit "" &&
|
||||
grep "^# Changes to be committed:" .git/COMMIT_EDITMSG
|
||||
test_i18ngrep "^# Changes to be committed:" .git/COMMIT_EDITMSG
|
||||
'
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT 'commit' '
|
||||
test_expect_success 'commit' '
|
||||
clear_config commit.status &&
|
||||
try_commit "" &&
|
||||
grep "^# Changes to be committed:" .git/COMMIT_EDITMSG
|
||||
test_i18ngrep "^# Changes to be committed:" .git/COMMIT_EDITMSG
|
||||
'
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT 'commit --status' '
|
||||
test_expect_success 'commit --status' '
|
||||
clear_config commit.status &&
|
||||
try_commit --status &&
|
||||
grep "^# Changes to be committed:" .git/COMMIT_EDITMSG
|
||||
test_i18ngrep "^# Changes to be committed:" .git/COMMIT_EDITMSG
|
||||
'
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT 'commit --no-status' '
|
||||
test_expect_success 'commit --no-status' '
|
||||
clear_config commit.status &&
|
||||
try_commit --no-status &&
|
||||
! grep "^# Changes to be committed:" .git/COMMIT_EDITMSG
|
||||
test_i18ngrep ! "^# Changes to be committed:" .git/COMMIT_EDITMSG
|
||||
'
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT 'commit with commit.status = yes' '
|
||||
test_expect_success 'commit with commit.status = yes' '
|
||||
clear_config commit.status &&
|
||||
git config commit.status yes &&
|
||||
try_commit "" &&
|
||||
grep "^# Changes to be committed:" .git/COMMIT_EDITMSG
|
||||
test_i18ngrep "^# Changes to be committed:" .git/COMMIT_EDITMSG
|
||||
'
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT 'commit with commit.status = no' '
|
||||
test_expect_success 'commit with commit.status = no' '
|
||||
clear_config commit.status &&
|
||||
git config commit.status no &&
|
||||
try_commit "" &&
|
||||
! grep "^# Changes to be committed:" .git/COMMIT_EDITMSG
|
||||
test_i18ngrep ! "^# Changes to be committed:" .git/COMMIT_EDITMSG
|
||||
'
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT 'commit --status with commit.status = yes' '
|
||||
test_expect_success 'commit --status with commit.status = yes' '
|
||||
clear_config commit.status &&
|
||||
git config commit.status yes &&
|
||||
try_commit --status &&
|
||||
grep "^# Changes to be committed:" .git/COMMIT_EDITMSG
|
||||
test_i18ngrep "^# Changes to be committed:" .git/COMMIT_EDITMSG
|
||||
'
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT 'commit --no-status with commit.status = yes' '
|
||||
test_expect_success 'commit --no-status with commit.status = yes' '
|
||||
clear_config commit.status &&
|
||||
git config commit.status yes &&
|
||||
try_commit --no-status &&
|
||||
! grep "^# Changes to be committed:" .git/COMMIT_EDITMSG
|
||||
test_i18ngrep ! "^# Changes to be committed:" .git/COMMIT_EDITMSG
|
||||
'
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT 'commit --status with commit.status = no' '
|
||||
test_expect_success 'commit --status with commit.status = no' '
|
||||
clear_config commit.status &&
|
||||
git config commit.status no &&
|
||||
try_commit --status &&
|
||||
grep "^# Changes to be committed:" .git/COMMIT_EDITMSG
|
||||
test_i18ngrep "^# Changes to be committed:" .git/COMMIT_EDITMSG
|
||||
'
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT 'commit --no-status with commit.status = no' '
|
||||
test_expect_success 'commit --no-status with commit.status = no' '
|
||||
clear_config commit.status &&
|
||||
git config commit.status no &&
|
||||
try_commit --no-status &&
|
||||
! grep "^# Changes to be committed:" .git/COMMIT_EDITMSG
|
||||
test_i18ngrep ! "^# Changes to be committed:" .git/COMMIT_EDITMSG
|
||||
'
|
||||
|
||||
}
|
||||
|
||||
@@ -20,21 +20,21 @@ test_expect_success 'setup' '
|
||||
git commit -m "Add submodule sub"
|
||||
'
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT 'status clean' '
|
||||
test_expect_success 'status clean' '
|
||||
git status >output &&
|
||||
grep "nothing to commit" output
|
||||
test_i18ngrep "nothing to commit" output
|
||||
'
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT 'commit --dry-run -a clean' '
|
||||
test_expect_success 'commit --dry-run -a clean' '
|
||||
test_must_fail git commit --dry-run -a >output &&
|
||||
grep "nothing to commit" output
|
||||
test_i18ngrep "nothing to commit" output
|
||||
'
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT 'status with modified file in submodule' '
|
||||
test_expect_success 'status with modified file in submodule' '
|
||||
(cd sub && git reset --hard) &&
|
||||
echo "changed" >sub/foo &&
|
||||
git status >output &&
|
||||
grep "modified: sub (modified content)" output
|
||||
test_i18ngrep "modified: sub (modified content)" output
|
||||
'
|
||||
|
||||
test_expect_success 'status with modified file in submodule (porcelain)' '
|
||||
@@ -46,10 +46,10 @@ test_expect_success 'status with modified file in submodule (porcelain)' '
|
||||
EOF
|
||||
'
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT 'status with added file in submodule' '
|
||||
test_expect_success 'status with added file in submodule' '
|
||||
(cd sub && git reset --hard && echo >foo && git add foo) &&
|
||||
git status >output &&
|
||||
grep "modified: sub (modified content)" output
|
||||
test_i18ngrep "modified: sub (modified content)" output
|
||||
'
|
||||
|
||||
test_expect_success 'status with added file in submodule (porcelain)' '
|
||||
@@ -60,16 +60,16 @@ test_expect_success 'status with added file in submodule (porcelain)' '
|
||||
EOF
|
||||
'
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT 'status with untracked file in submodule' '
|
||||
test_expect_success 'status with untracked file in submodule' '
|
||||
(cd sub && git reset --hard) &&
|
||||
echo "content" >sub/new-file &&
|
||||
git status >output &&
|
||||
grep "modified: sub (untracked content)" output
|
||||
test_i18ngrep "modified: sub (untracked content)" output
|
||||
'
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT 'status -uno with untracked file in submodule' '
|
||||
test_expect_success 'status -uno with untracked file in submodule' '
|
||||
git status -uno >output &&
|
||||
grep "^nothing to commit" output
|
||||
test_i18ngrep "^nothing to commit" output
|
||||
'
|
||||
|
||||
test_expect_success 'status with untracked file in submodule (porcelain)' '
|
||||
@@ -79,11 +79,11 @@ test_expect_success 'status with untracked file in submodule (porcelain)' '
|
||||
EOF
|
||||
'
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT 'status with added and untracked file in submodule' '
|
||||
test_expect_success 'status with added and untracked file in submodule' '
|
||||
(cd sub && git reset --hard && echo >foo && git add foo) &&
|
||||
echo "content" >sub/new-file &&
|
||||
git status >output &&
|
||||
grep "modified: sub (modified content, untracked content)" output
|
||||
test_i18ngrep "modified: sub (modified content, untracked content)" output
|
||||
'
|
||||
|
||||
test_expect_success 'status with added and untracked file in submodule (porcelain)' '
|
||||
@@ -95,13 +95,13 @@ test_expect_success 'status with added and untracked file in submodule (porcelai
|
||||
EOF
|
||||
'
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT 'status with modified file in modified submodule' '
|
||||
test_expect_success 'status with modified file in modified submodule' '
|
||||
(cd sub && git reset --hard) &&
|
||||
rm sub/new-file &&
|
||||
(cd sub && echo "next change" >foo && git commit -m "next change" foo) &&
|
||||
echo "changed" >sub/foo &&
|
||||
git status >output &&
|
||||
grep "modified: sub (new commits, modified content)" output
|
||||
test_i18ngrep "modified: sub (new commits, modified content)" output
|
||||
'
|
||||
|
||||
test_expect_success 'status with modified file in modified submodule (porcelain)' '
|
||||
@@ -113,10 +113,10 @@ test_expect_success 'status with modified file in modified submodule (porcelain)
|
||||
EOF
|
||||
'
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT 'status with added file in modified submodule' '
|
||||
test_expect_success 'status with added file in modified submodule' '
|
||||
(cd sub && git reset --hard && echo >foo && git add foo) &&
|
||||
git status >output &&
|
||||
grep "modified: sub (new commits, modified content)" output
|
||||
test_i18ngrep "modified: sub (new commits, modified content)" output
|
||||
'
|
||||
|
||||
test_expect_success 'status with added file in modified submodule (porcelain)' '
|
||||
@@ -127,11 +127,11 @@ test_expect_success 'status with added file in modified submodule (porcelain)' '
|
||||
EOF
|
||||
'
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT 'status with untracked file in modified submodule' '
|
||||
test_expect_success 'status with untracked file in modified submodule' '
|
||||
(cd sub && git reset --hard) &&
|
||||
echo "content" >sub/new-file &&
|
||||
git status >output &&
|
||||
grep "modified: sub (new commits, untracked content)" output
|
||||
test_i18ngrep "modified: sub (new commits, untracked content)" output
|
||||
'
|
||||
|
||||
test_expect_success 'status with untracked file in modified submodule (porcelain)' '
|
||||
@@ -141,11 +141,11 @@ test_expect_success 'status with untracked file in modified submodule (porcelain
|
||||
EOF
|
||||
'
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT 'status with added and untracked file in modified submodule' '
|
||||
test_expect_success 'status with added and untracked file in modified submodule' '
|
||||
(cd sub && git reset --hard && echo >foo && git add foo) &&
|
||||
echo "content" >sub/new-file &&
|
||||
git status >output &&
|
||||
grep "modified: sub (new commits, modified content, untracked content)" output
|
||||
test_i18ngrep "modified: sub (new commits, modified content, untracked content)" output
|
||||
'
|
||||
|
||||
test_expect_success 'status with added and untracked file in modified submodule (porcelain)' '
|
||||
@@ -167,24 +167,24 @@ test_expect_success 'setup .git file for sub' '
|
||||
git commit -m "added .real to .gitignore" .gitignore
|
||||
'
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT 'status with added file in modified submodule with .git file' '
|
||||
test_expect_success 'status with added file in modified submodule with .git file' '
|
||||
(cd sub && git reset --hard && echo >foo && git add foo) &&
|
||||
git status >output &&
|
||||
grep "modified: sub (new commits, modified content)" output
|
||||
test_i18ngrep "modified: sub (new commits, modified content)" output
|
||||
'
|
||||
|
||||
test_expect_success 'rm submodule contents' '
|
||||
rm -rf sub/* sub/.git
|
||||
'
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT 'status clean (empty submodule dir)' '
|
||||
test_expect_success 'status clean (empty submodule dir)' '
|
||||
git status >output &&
|
||||
grep "nothing to commit" output
|
||||
test_i18ngrep "nothing to commit" output
|
||||
'
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT 'status -a clean (empty submodule dir)' '
|
||||
test_expect_success 'status -a clean (empty submodule dir)' '
|
||||
test_must_fail git commit --dry-run -a >output &&
|
||||
grep "nothing to commit" output
|
||||
test_i18ngrep "nothing to commit" output
|
||||
'
|
||||
|
||||
test_done
|
||||
|
||||
@@ -16,7 +16,7 @@ test_expect_success 'status -h in broken repository' '
|
||||
echo "[status] showuntrackedfiles = CORRUPT" >>.git/config &&
|
||||
test_expect_code 129 git status -h >usage 2>&1
|
||||
) &&
|
||||
grep "[Uu]sage" broken/usage
|
||||
test_i18ngrep "[Uu]sage" broken/usage
|
||||
'
|
||||
|
||||
test_expect_success 'commit -h in broken repository' '
|
||||
@@ -28,7 +28,7 @@ test_expect_success 'commit -h in broken repository' '
|
||||
echo "[status] showuntrackedfiles = CORRUPT" >>.git/config &&
|
||||
test_expect_code 129 git commit -h >usage 2>&1
|
||||
) &&
|
||||
grep "[Uu]sage" broken/usage
|
||||
test_i18ngrep "[Uu]sage" broken/usage
|
||||
'
|
||||
|
||||
test_expect_success 'setup' '
|
||||
@@ -55,10 +55,8 @@ test_expect_success 'setup' '
|
||||
git add dir2/added
|
||||
'
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT 'status (1)' '
|
||||
|
||||
grep "use \"git rm --cached <file>\.\.\.\" to unstage" output
|
||||
|
||||
test_expect_success 'status (1)' '
|
||||
test_i18ngrep "use \"git rm --cached <file>\.\.\.\" to unstage" output
|
||||
'
|
||||
|
||||
cat >expect <<\EOF
|
||||
@@ -85,11 +83,9 @@ cat >expect <<\EOF
|
||||
# untracked
|
||||
EOF
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT 'status (2)' '
|
||||
|
||||
test_expect_success 'status (2)' '
|
||||
git status >output &&
|
||||
test_cmp expect output
|
||||
|
||||
test_i18ncmp expect output
|
||||
'
|
||||
|
||||
cat >expect <<\EOF
|
||||
@@ -109,17 +105,14 @@ cat >expect <<\EOF
|
||||
# untracked
|
||||
EOF
|
||||
|
||||
git config advice.statusHints false
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT 'status (advice.statusHints false)' '
|
||||
|
||||
test_expect_success 'status (advice.statusHints false)' '
|
||||
test_when_finished "git config --unset advice.statusHints" &&
|
||||
git config advice.statusHints false &&
|
||||
git status >output &&
|
||||
test_cmp expect output
|
||||
test_i18ncmp expect output
|
||||
|
||||
'
|
||||
|
||||
git config --unset advice.statusHints
|
||||
|
||||
cat >expect <<\EOF
|
||||
M dir1/modified
|
||||
A dir2/added
|
||||
@@ -178,16 +171,16 @@ cat >expect <<EOF
|
||||
#
|
||||
# Untracked files not listed (use -u option to show untracked files)
|
||||
EOF
|
||||
test_expect_success C_LOCALE_OUTPUT 'status -uno' '
|
||||
test_expect_success 'status -uno' '
|
||||
git status -uno >output &&
|
||||
test_cmp expect output
|
||||
test_i18ncmp expect output
|
||||
'
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT 'status (status.showUntrackedFiles no)' '
|
||||
test_expect_success 'status (status.showUntrackedFiles no)' '
|
||||
git config status.showuntrackedfiles no
|
||||
test_when_finished "git config --unset status.showuntrackedfiles" &&
|
||||
git status >output &&
|
||||
test_cmp expect output
|
||||
test_i18ncmp expect output
|
||||
'
|
||||
|
||||
cat >expect <<EOF
|
||||
@@ -201,9 +194,9 @@ cat >expect <<EOF
|
||||
# Untracked files not listed
|
||||
EOF
|
||||
git config advice.statusHints false
|
||||
test_expect_success C_LOCALE_OUTPUT 'status -uno (advice.statusHints false)' '
|
||||
test_expect_success 'status -uno (advice.statusHints false)' '
|
||||
git status -uno >output &&
|
||||
test_cmp expect output
|
||||
test_i18ncmp expect output
|
||||
'
|
||||
git config --unset advice.statusHints
|
||||
|
||||
@@ -246,16 +239,16 @@ cat >expect <<EOF
|
||||
# output
|
||||
# untracked
|
||||
EOF
|
||||
test_expect_success C_LOCALE_OUTPUT 'status -unormal' '
|
||||
test_expect_success 'status -unormal' '
|
||||
git status -unormal >output &&
|
||||
test_cmp expect output
|
||||
test_i18ncmp expect output
|
||||
'
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT 'status (status.showUntrackedFiles normal)' '
|
||||
test_expect_success 'status (status.showUntrackedFiles normal)' '
|
||||
git config status.showuntrackedfiles normal
|
||||
test_when_finished "git config --unset status.showuntrackedfiles" &&
|
||||
git status >output &&
|
||||
test_cmp expect output
|
||||
test_i18ncmp expect output
|
||||
'
|
||||
|
||||
cat >expect <<EOF
|
||||
@@ -305,15 +298,16 @@ cat >expect <<EOF
|
||||
# output
|
||||
# untracked
|
||||
EOF
|
||||
test_expect_success C_LOCALE_OUTPUT 'status -uall' '
|
||||
test_expect_success 'status -uall' '
|
||||
git status -uall >output &&
|
||||
test_cmp expect output
|
||||
test_i18ncmp expect output
|
||||
'
|
||||
test_expect_success C_LOCALE_OUTPUT 'status (status.showUntrackedFiles all)' '
|
||||
|
||||
test_expect_success 'status (status.showUntrackedFiles all)' '
|
||||
git config status.showuntrackedfiles all
|
||||
test_when_finished "git config --unset status.showuntrackedfiles" &&
|
||||
git status >output &&
|
||||
test_cmp expect output
|
||||
test_i18ncmp expect output
|
||||
'
|
||||
|
||||
test_expect_success 'teardown dir3' '
|
||||
@@ -367,11 +361,9 @@ cat >expect <<\EOF
|
||||
# ../untracked
|
||||
EOF
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT 'status with relative paths' '
|
||||
|
||||
test_expect_success 'status with relative paths' '
|
||||
(cd dir1 && git status) >output &&
|
||||
test_cmp expect output
|
||||
|
||||
test_i18ncmp expect output
|
||||
'
|
||||
|
||||
cat >expect <<\EOF
|
||||
@@ -440,22 +432,18 @@ cat >expect <<\EOF
|
||||
# <BLUE>untracked<RESET>
|
||||
EOF
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT 'status with color.ui' '
|
||||
|
||||
test_expect_success 'status with color.ui' '
|
||||
git config color.ui always &&
|
||||
test_when_finished "git config --unset color.ui" &&
|
||||
git status | test_decode_color >output &&
|
||||
test_cmp expect output
|
||||
|
||||
test_i18ncmp expect output
|
||||
'
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT 'status with color.status' '
|
||||
|
||||
test_expect_success 'status with color.status' '
|
||||
git config color.status always &&
|
||||
test_when_finished "git config --unset color.status" &&
|
||||
git status | test_decode_color >output &&
|
||||
test_cmp expect output
|
||||
|
||||
test_i18ncmp expect output
|
||||
'
|
||||
|
||||
cat >expect <<\EOF
|
||||
@@ -570,12 +558,12 @@ cat >expect <<\EOF
|
||||
EOF
|
||||
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT 'status without relative paths' '
|
||||
test_expect_success 'status without relative paths' '
|
||||
|
||||
git config status.relativePaths false &&
|
||||
test_when_finished "git config --unset status.relativePaths" &&
|
||||
(cd dir1 && git status) >output &&
|
||||
test_cmp expect output
|
||||
test_i18ncmp expect output
|
||||
|
||||
'
|
||||
|
||||
@@ -616,11 +604,8 @@ cat <<EOF >expect
|
||||
# untracked
|
||||
EOF
|
||||
test_expect_success 'dry-run of partial commit excluding new file in index' '
|
||||
git commit --dry-run dir1/modified >output
|
||||
'
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT 'dry-run of partial commit excluding new file in index: output' '
|
||||
test_cmp expect output
|
||||
git commit --dry-run dir1/modified >output &&
|
||||
test_i18ncmp expect output
|
||||
'
|
||||
|
||||
cat >expect <<EOF
|
||||
@@ -667,15 +652,15 @@ cat >expect <<EOF
|
||||
# output
|
||||
# untracked
|
||||
EOF
|
||||
test_expect_success C_LOCALE_OUTPUT 'status submodule summary is disabled by default' '
|
||||
test_expect_success 'status submodule summary is disabled by default' '
|
||||
git status >output &&
|
||||
test_cmp expect output
|
||||
test_i18ncmp expect output
|
||||
'
|
||||
|
||||
# we expect the same as the previous test
|
||||
test_expect_success C_LOCALE_OUTPUT 'status --untracked-files=all does not show submodule' '
|
||||
test_expect_success 'status --untracked-files=all does not show submodule' '
|
||||
git status --untracked-files=all >output &&
|
||||
test_cmp expect output
|
||||
test_i18ncmp expect output
|
||||
'
|
||||
|
||||
cat >expect <<EOF
|
||||
@@ -731,14 +716,10 @@ cat >expect <<EOF
|
||||
# output
|
||||
# untracked
|
||||
EOF
|
||||
test_expect_success C_LOCALE_OUTPUT 'status submodule summary' '
|
||||
test_expect_success 'status submodule summary' '
|
||||
git config status.submodulesummary 10 &&
|
||||
git status >output &&
|
||||
if test_have_prereq MINGW
|
||||
then
|
||||
dos2unix output
|
||||
fi &&
|
||||
test_cmp expect output
|
||||
test_i18ncmp expect output
|
||||
'
|
||||
|
||||
cat >expect <<EOF
|
||||
@@ -754,10 +735,6 @@ A sm
|
||||
EOF
|
||||
test_expect_success 'status -s submodule summary' '
|
||||
git status -s >output &&
|
||||
if test_have_prereq MINGW
|
||||
then
|
||||
dos2unix output
|
||||
fi &&
|
||||
test_cmp expect output
|
||||
'
|
||||
|
||||
@@ -781,23 +758,12 @@ cat >expect <<EOF
|
||||
no changes added to commit (use "git add" and/or "git commit -a")
|
||||
EOF
|
||||
test_expect_success 'status submodule summary (clean submodule): commit' '
|
||||
git commit -m "commit submodule"
|
||||
'
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT 'status submodule summary (clean submodule): output' '
|
||||
git commit -m "commit submodule" &&
|
||||
git config status.submodulesummary 10 &&
|
||||
test_must_fail git commit --dry-run >output &&
|
||||
if test_have_prereq MINGW
|
||||
then
|
||||
dos2unix output
|
||||
fi &&
|
||||
test_cmp expect output &&
|
||||
test_i18ncmp expect output &&
|
||||
git status >output &&
|
||||
if test_have_prereq MINGW
|
||||
then
|
||||
dos2unix output
|
||||
fi &&
|
||||
test_cmp expect output
|
||||
test_i18ncmp expect output
|
||||
'
|
||||
|
||||
cat >expect <<EOF
|
||||
@@ -811,10 +777,6 @@ cat >expect <<EOF
|
||||
EOF
|
||||
test_expect_success 'status -s submodule summary (clean submodule)' '
|
||||
git status -s >output &&
|
||||
if test_have_prereq MINGW
|
||||
then
|
||||
dos2unix output
|
||||
fi &&
|
||||
test_cmp expect output
|
||||
'
|
||||
|
||||
@@ -847,14 +809,10 @@ cat >expect <<EOF
|
||||
# output
|
||||
# untracked
|
||||
EOF
|
||||
test_expect_success C_LOCALE_OUTPUT 'commit --dry-run submodule summary (--amend)' '
|
||||
test_expect_success 'commit --dry-run submodule summary (--amend)' '
|
||||
git config status.submodulesummary 10 &&
|
||||
git commit --dry-run --amend >output &&
|
||||
if test_have_prereq MINGW
|
||||
then
|
||||
dos2unix output
|
||||
fi &&
|
||||
test_cmp expect output
|
||||
test_i18ncmp expect output
|
||||
'
|
||||
|
||||
test_expect_success POSIXPERM,SANITY 'status succeeds in a read-only repository' '
|
||||
@@ -906,84 +864,84 @@ cat > expect << EOF
|
||||
# untracked
|
||||
EOF
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT '--ignore-submodules=untracked suppresses submodules with untracked content' '
|
||||
echo modified > sm/untracked &&
|
||||
git status --ignore-submodules=untracked > output &&
|
||||
test_cmp expect output
|
||||
test_expect_success '--ignore-submodules=untracked suppresses submodules with untracked content' '
|
||||
echo modified sm/untracked &&
|
||||
git status --ignore-submodules=untracked >output &&
|
||||
test_i18ncmp expect output
|
||||
'
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT '.gitmodules ignore=untracked suppresses submodules with untracked content' '
|
||||
test_expect_success '.gitmodules ignore=untracked suppresses submodules with untracked content' '
|
||||
git config diff.ignoreSubmodules dirty &&
|
||||
git status >output &&
|
||||
test_cmp expect output &&
|
||||
test_i18ncmp expect output &&
|
||||
git config --add -f .gitmodules submodule.subname.ignore untracked &&
|
||||
git config --add -f .gitmodules submodule.subname.path sm &&
|
||||
git status > output &&
|
||||
test_cmp expect output &&
|
||||
git status >output &&
|
||||
test_i18ncmp expect output &&
|
||||
git config -f .gitmodules --remove-section submodule.subname &&
|
||||
git config --unset diff.ignoreSubmodules
|
||||
'
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT '.git/config ignore=untracked suppresses submodules with untracked content' '
|
||||
test_expect_success '.git/config ignore=untracked suppresses submodules with untracked content' '
|
||||
git config --add -f .gitmodules submodule.subname.ignore none &&
|
||||
git config --add -f .gitmodules submodule.subname.path sm &&
|
||||
git config --add submodule.subname.ignore untracked &&
|
||||
git config --add submodule.subname.path sm &&
|
||||
git status > output &&
|
||||
test_cmp expect output &&
|
||||
git status >output &&
|
||||
test_i18ncmp expect output &&
|
||||
git config --remove-section submodule.subname &&
|
||||
git config --remove-section -f .gitmodules submodule.subname
|
||||
'
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT '--ignore-submodules=dirty suppresses submodules with untracked content' '
|
||||
git status --ignore-submodules=dirty > output &&
|
||||
test_cmp expect output
|
||||
test_expect_success '--ignore-submodules=dirty suppresses submodules with untracked content' '
|
||||
git status --ignore-submodules=dirty >output &&
|
||||
test_i18ncmp expect output
|
||||
'
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT '.gitmodules ignore=dirty suppresses submodules with untracked content' '
|
||||
test_expect_success '.gitmodules ignore=dirty suppresses submodules with untracked content' '
|
||||
git config diff.ignoreSubmodules dirty &&
|
||||
git status >output &&
|
||||
! test -s actual &&
|
||||
git config --add -f .gitmodules submodule.subname.ignore dirty &&
|
||||
git config --add -f .gitmodules submodule.subname.path sm &&
|
||||
git status > output &&
|
||||
test_cmp expect output &&
|
||||
git status >output &&
|
||||
test_i18ncmp expect output &&
|
||||
git config -f .gitmodules --remove-section submodule.subname &&
|
||||
git config --unset diff.ignoreSubmodules
|
||||
'
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT '.git/config ignore=dirty suppresses submodules with untracked content' '
|
||||
test_expect_success '.git/config ignore=dirty suppresses submodules with untracked content' '
|
||||
git config --add -f .gitmodules submodule.subname.ignore none &&
|
||||
git config --add -f .gitmodules submodule.subname.path sm &&
|
||||
git config --add submodule.subname.ignore dirty &&
|
||||
git config --add submodule.subname.path sm &&
|
||||
git status > output &&
|
||||
test_cmp expect output &&
|
||||
git status >output &&
|
||||
test_i18ncmp expect output &&
|
||||
git config --remove-section submodule.subname &&
|
||||
git config -f .gitmodules --remove-section submodule.subname
|
||||
'
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT '--ignore-submodules=dirty suppresses submodules with modified content' '
|
||||
echo modified > sm/foo &&
|
||||
git status --ignore-submodules=dirty > output &&
|
||||
test_cmp expect output
|
||||
test_expect_success '--ignore-submodules=dirty suppresses submodules with modified content' '
|
||||
echo modified >sm/foo &&
|
||||
git status --ignore-submodules=dirty >output &&
|
||||
test_i18ncmp expect output
|
||||
'
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT '.gitmodules ignore=dirty suppresses submodules with modified content' '
|
||||
test_expect_success '.gitmodules ignore=dirty suppresses submodules with modified content' '
|
||||
git config --add -f .gitmodules submodule.subname.ignore dirty &&
|
||||
git config --add -f .gitmodules submodule.subname.path sm &&
|
||||
git status > output &&
|
||||
test_cmp expect output &&
|
||||
git status >output &&
|
||||
test_i18ncmp expect output &&
|
||||
git config -f .gitmodules --remove-section submodule.subname
|
||||
'
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT '.git/config ignore=dirty suppresses submodules with modified content' '
|
||||
test_expect_success '.git/config ignore=dirty suppresses submodules with modified content' '
|
||||
git config --add -f .gitmodules submodule.subname.ignore none &&
|
||||
git config --add -f .gitmodules submodule.subname.path sm &&
|
||||
git config --add submodule.subname.ignore dirty &&
|
||||
git config --add submodule.subname.path sm &&
|
||||
git status > output &&
|
||||
test_cmp expect output &&
|
||||
git status >output &&
|
||||
test_i18ncmp expect output &&
|
||||
git config --remove-section submodule.subname &&
|
||||
git config -f .gitmodules --remove-section submodule.subname
|
||||
'
|
||||
@@ -1020,26 +978,26 @@ cat > expect << EOF
|
||||
# untracked
|
||||
EOF
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT "--ignore-submodules=untracked doesn't suppress submodules with modified content" '
|
||||
test_expect_success "--ignore-submodules=untracked doesn't suppress submodules with modified content" '
|
||||
git status --ignore-submodules=untracked > output &&
|
||||
test_cmp expect output
|
||||
test_i18ncmp expect output
|
||||
'
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT ".gitmodules ignore=untracked doesn't suppress submodules with modified content" '
|
||||
test_expect_success ".gitmodules ignore=untracked doesn't suppress submodules with modified content" '
|
||||
git config --add -f .gitmodules submodule.subname.ignore untracked &&
|
||||
git config --add -f .gitmodules submodule.subname.path sm &&
|
||||
git status > output &&
|
||||
test_cmp expect output &&
|
||||
git status >output &&
|
||||
test_i18ncmp expect output &&
|
||||
git config -f .gitmodules --remove-section submodule.subname
|
||||
'
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT ".git/config ignore=untracked doesn't suppress submodules with modified content" '
|
||||
test_expect_success ".git/config ignore=untracked doesn't suppress submodules with modified content" '
|
||||
git config --add -f .gitmodules submodule.subname.ignore none &&
|
||||
git config --add -f .gitmodules submodule.subname.path sm &&
|
||||
git config --add submodule.subname.ignore untracked &&
|
||||
git config --add submodule.subname.path sm &&
|
||||
git status > output &&
|
||||
test_cmp expect output &&
|
||||
git status >output &&
|
||||
test_i18ncmp expect output &&
|
||||
git config --remove-section submodule.subname &&
|
||||
git config -f .gitmodules --remove-section submodule.subname
|
||||
'
|
||||
@@ -1082,49 +1040,49 @@ cat > expect << EOF
|
||||
# untracked
|
||||
EOF
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT "--ignore-submodules=untracked doesn't suppress submodule summary" '
|
||||
test_expect_success "--ignore-submodules=untracked doesn't suppress submodule summary" '
|
||||
git status --ignore-submodules=untracked > output &&
|
||||
test_cmp expect output
|
||||
test_i18ncmp expect output
|
||||
'
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT ".gitmodules ignore=untracked doesn't suppress submodule summary" '
|
||||
test_expect_success ".gitmodules ignore=untracked doesn't suppress submodule summary" '
|
||||
git config --add -f .gitmodules submodule.subname.ignore untracked &&
|
||||
git config --add -f .gitmodules submodule.subname.path sm &&
|
||||
git status > output &&
|
||||
test_cmp expect output &&
|
||||
git status >output &&
|
||||
test_i18ncmp expect output &&
|
||||
git config -f .gitmodules --remove-section submodule.subname
|
||||
'
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT ".git/config ignore=untracked doesn't suppress submodule summary" '
|
||||
test_expect_success ".git/config ignore=untracked doesn't suppress submodule summary" '
|
||||
git config --add -f .gitmodules submodule.subname.ignore none &&
|
||||
git config --add -f .gitmodules submodule.subname.path sm &&
|
||||
git config --add submodule.subname.ignore untracked &&
|
||||
git config --add submodule.subname.path sm &&
|
||||
git status > output &&
|
||||
test_cmp expect output &&
|
||||
git status >output &&
|
||||
test_i18ncmp expect output &&
|
||||
git config --remove-section submodule.subname &&
|
||||
git config -f .gitmodules --remove-section submodule.subname
|
||||
'
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT "--ignore-submodules=dirty doesn't suppress submodule summary" '
|
||||
test_expect_success "--ignore-submodules=dirty doesn't suppress submodule summary" '
|
||||
git status --ignore-submodules=dirty > output &&
|
||||
test_cmp expect output
|
||||
test_i18ncmp expect output
|
||||
'
|
||||
test_expect_success C_LOCALE_OUTPUT ".gitmodules ignore=dirty doesn't suppress submodule summary" '
|
||||
test_expect_success ".gitmodules ignore=dirty doesn't suppress submodule summary" '
|
||||
git config --add -f .gitmodules submodule.subname.ignore dirty &&
|
||||
git config --add -f .gitmodules submodule.subname.path sm &&
|
||||
git status > output &&
|
||||
test_cmp expect output &&
|
||||
git status >output &&
|
||||
test_i18ncmp expect output &&
|
||||
git config -f .gitmodules --remove-section submodule.subname
|
||||
'
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT ".git/config ignore=dirty doesn't suppress submodule summary" '
|
||||
test_expect_success ".git/config ignore=dirty doesn't suppress submodule summary" '
|
||||
git config --add -f .gitmodules submodule.subname.ignore none &&
|
||||
git config --add -f .gitmodules submodule.subname.path sm &&
|
||||
git config --add submodule.subname.ignore dirty &&
|
||||
git config --add submodule.subname.path sm &&
|
||||
git status > output &&
|
||||
test_cmp expect output &&
|
||||
git status >output &&
|
||||
test_i18ncmp expect output &&
|
||||
git config --remove-section submodule.subname &&
|
||||
git config -f .gitmodules --remove-section submodule.subname
|
||||
'
|
||||
@@ -1150,9 +1108,9 @@ cat > expect << EOF
|
||||
no changes added to commit (use "git add" and/or "git commit -a")
|
||||
EOF
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT "--ignore-submodules=all suppresses submodule summary" '
|
||||
test_expect_success "--ignore-submodules=all suppresses submodule summary" '
|
||||
git status --ignore-submodules=all > output &&
|
||||
test_cmp expect output
|
||||
test_i18ncmp expect output
|
||||
'
|
||||
|
||||
test_expect_failure '.gitmodules ignore=all suppresses submodule summary' '
|
||||
|
||||
@@ -495,10 +495,10 @@ test_expect_success 'merge fast-forward in a dirty tree' '
|
||||
|
||||
test_debug 'git log --graph --decorate --oneline --all'
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT 'in-index merge' '
|
||||
test_expect_success 'in-index merge' '
|
||||
git reset --hard c0 &&
|
||||
git merge --no-ff -s resolve c1 >out &&
|
||||
grep "Wonderful." out &&
|
||||
test_i18ngrep "Wonderful." out &&
|
||||
verify_parents $c0 $c1
|
||||
'
|
||||
|
||||
|
||||
@@ -150,11 +150,8 @@ test_expect_success 'will not overwrite untracked file on unborn branch' '
|
||||
git rm -fr . &&
|
||||
git checkout --orphan new &&
|
||||
cp important c0.c &&
|
||||
test_must_fail git merge c0 2>out
|
||||
'
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT 'will not overwrite untracked file on unborn branch: output' '
|
||||
test_cmp out expect
|
||||
test_must_fail git merge c0 2>out &&
|
||||
test_i18ncmp out expect
|
||||
'
|
||||
|
||||
test_expect_success 'will not overwrite untracked file on unborn branch .git/MERGE_HEAD sanity etc.' '
|
||||
|
||||
@@ -46,11 +46,8 @@ test_expect_success 'setup' '
|
||||
pre_merge_head="$(git rev-parse HEAD)"
|
||||
|
||||
test_expect_success 'fails without MERGE_HEAD (unstarted merge)' '
|
||||
test_must_fail git merge --abort 2>output
|
||||
'
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT 'fails without MERGE_HEAD (unstarted merge): fatal output' '
|
||||
grep -q MERGE_HEAD output
|
||||
test_must_fail git merge --abort 2>output &&
|
||||
test_i18ngrep MERGE_HEAD output
|
||||
'
|
||||
|
||||
test_expect_success 'fails without MERGE_HEAD (unstarted merge): .git/MERGE_HEAD sanity' '
|
||||
@@ -63,11 +60,8 @@ test_expect_success 'fails without MERGE_HEAD (completed merge)' '
|
||||
test ! -f .git/MERGE_HEAD &&
|
||||
# Merge successfully completed
|
||||
post_merge_head="$(git rev-parse HEAD)" &&
|
||||
test_must_fail git merge --abort 2>output
|
||||
'
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT 'fails without MERGE_HEAD (completed merge): output' '
|
||||
grep -q MERGE_HEAD output
|
||||
test_must_fail git merge --abort 2>output &&
|
||||
test_i18ngrep MERGE_HEAD output
|
||||
'
|
||||
|
||||
test_expect_success 'fails without MERGE_HEAD (completed merge): .git/MERGE_HEAD sanity' '
|
||||
|
||||
@@ -61,9 +61,9 @@ test_expect_success SIMPLEPAGER 'git grep -O' '
|
||||
test_cmp empty out
|
||||
'
|
||||
|
||||
test_expect_success C_LOCALE_OUTPUT 'git grep -O --cached' '
|
||||
test_expect_success 'git grep -O --cached' '
|
||||
test_must_fail git grep --cached -O GREP_PATTERN >out 2>msg &&
|
||||
grep open-files-in-pager msg
|
||||
test_i18ngrep open-files-in-pager msg
|
||||
'
|
||||
|
||||
test_expect_success 'git grep -O --no-index' '
|
||||
|
||||
@@ -1089,6 +1089,24 @@ test_i18ncmp () {
|
||||
test -n "$GETTEXT_POISON" || test_cmp "$@"
|
||||
}
|
||||
|
||||
# Use this instead of "grep expected-string actual" to see if the
|
||||
# output from a git command that can be translated either contains an
|
||||
# expected string, or does not contain an unwanted one. When running
|
||||
# under GETTEXT_POISON this pretends that the command produced expected
|
||||
# results.
|
||||
test_i18ngrep () {
|
||||
if test -n "$GETTEXT_POISON"
|
||||
then
|
||||
: # pretend success
|
||||
elif test "x!" = "x$1"
|
||||
then
|
||||
shift
|
||||
! grep "$@"
|
||||
else
|
||||
grep "$@"
|
||||
fi
|
||||
}
|
||||
|
||||
# test whether the filesystem supports symbolic links
|
||||
ln -s x y 2>/dev/null && test -h y 2>/dev/null && test_set_prereq SYMLINKS
|
||||
rm -f y
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#include "line_buffer.h"
|
||||
#include "string_pool.h"
|
||||
#include "strbuf.h"
|
||||
#include "svndump.h"
|
||||
|
||||
/*
|
||||
* Compare start of string to literal of equal length;
|
||||
|
||||
Reference in New Issue
Block a user