aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Documentation/git-clone.txt13
-rw-r--r--Documentation/git-cvsimport.txt4
-rw-r--r--builtin-pack-objects.c13
-rwxr-xr-xgit-bisect.sh2
-rwxr-xr-xgit-cvsimport.perl2
-rwxr-xr-xgit-sh-setup.sh2
-rwxr-xr-xt/t3404-rebase-interactive.sh22
-rwxr-xr-xt/t7502-status.sh11
-rw-r--r--upload-pack.c3
-rw-r--r--wt-status.c2
10 files changed, 50 insertions, 24 deletions
diff --git a/Documentation/git-clone.txt b/Documentation/git-clone.txt
index 234188161..975824301 100644
--- a/Documentation/git-clone.txt
+++ b/Documentation/git-clone.txt
@@ -62,12 +62,13 @@ OPTIONS
.git/objects/info/alternates to share the objects
with the source repository. The resulting repository
starts out without any object of its own.
- *NOTE*: this is a possibly dangerous operation; do *not* use
- it unless you understand what it does. If you clone your
- repository using this option, then delete branches in the
- source repository and then run linkgit:git-gc[1] using the
- '--prune' option in the source repository, it may remove
- objects which are referenced by the cloned repository.
++
+*NOTE*: this is a possibly dangerous operation; do *not* use
+it unless you understand what it does. If you clone your
+repository using this option, then delete branches in the
+source repository and then run linkgit:git-gc[1] using the
+'--prune' option in the source repository, it may remove
+objects which are referenced by the cloned repository.
diff --git a/Documentation/git-cvsimport.txt b/Documentation/git-cvsimport.txt
index dbce50369..6f91b9ea2 100644
--- a/Documentation/git-cvsimport.txt
+++ b/Documentation/git-cvsimport.txt
@@ -107,8 +107,8 @@ If you need to pass multiple options, separate them with a comma.
-M <regex>::
Attempt to detect merges based on the commit message with a custom
- regex. It can be used with '-m' to also see the default regexes.
- You must escape forward slashes.
+ regex. It can be used with '-m' to enable the default regexes
+ as well. You must escape forward slashes.
-S <regex>::
Skip paths matching the regex.
diff --git a/builtin-pack-objects.c b/builtin-pack-objects.c
index acb05554d..692a76126 100644
--- a/builtin-pack-objects.c
+++ b/builtin-pack-objects.c
@@ -1464,7 +1464,7 @@ static unsigned int check_delta_limit(struct object_entry *me, unsigned int n)
return m;
}
-static unsigned long free_unpacked_data(struct unpacked *n)
+static unsigned long free_unpacked(struct unpacked *n)
{
unsigned long freed_mem = sizeof_delta_index(n->index);
free_delta_index(n->index);
@@ -1474,12 +1474,6 @@ static unsigned long free_unpacked_data(struct unpacked *n)
free(n->data);
n->data = NULL;
}
- return freed_mem;
-}
-
-static unsigned long free_unpacked(struct unpacked *n)
-{
- unsigned long freed_mem = free_unpacked_data(n);
n->entry = NULL;
n->depth = 0;
return freed_mem;
@@ -1520,7 +1514,7 @@ static void find_deltas(struct object_entry **list, unsigned *list_size,
mem_usage > window_memory_limit &&
count > 1) {
uint32_t tail = (idx + window - count) % window;
- mem_usage -= free_unpacked_data(array + tail);
+ mem_usage -= free_unpacked(array + tail);
count--;
}
@@ -1553,9 +1547,6 @@ static void find_deltas(struct object_entry **list, unsigned *list_size,
if (!m->entry)
break;
ret = try_delta(n, m, max_depth, &mem_usage);
- if (window_memory_limit &&
- mem_usage > window_memory_limit)
- mem_usage -= free_unpacked_data(m);
if (ret < 0)
break;
else if (ret > 0)
diff --git a/git-bisect.sh b/git-bisect.sh
index 393fa3558..6594a6291 100755
--- a/git-bisect.sh
+++ b/git-bisect.sh
@@ -135,7 +135,7 @@ bisect_write() {
*) die "Bad bisect_write argument: $state" ;;
esac
git update-ref "refs/bisect/$tag" "$rev"
- echo "# $state: "$(git show-branch $rev) >>"$GIT_DIR/BISECT_LOG"
+ echo "# $state: $(git show-branch $rev)" >>"$GIT_DIR/BISECT_LOG"
test -z "$nolog" && echo "git-bisect $state $rev" >>"$GIT_DIR/BISECT_LOG"
}
diff --git a/git-cvsimport.perl b/git-cvsimport.perl
index 5694978c4..951624233 100755
--- a/git-cvsimport.perl
+++ b/git-cvsimport.perl
@@ -164,7 +164,7 @@ if ($#ARGV == 0) {
our @mergerx = ();
if ($opt_m) {
- @mergerx = ( qr/\W(?:from|of|merge|merging|merged) (\w+)/i );
+ @mergerx = ( qr/\b(?:from|of|merge|merging|merged) (\w+)/i );
}
if ($opt_M) {
push (@mergerx, qr/$opt_M/);
diff --git a/git-sh-setup.sh b/git-sh-setup.sh
index aae14090b..f38827529 100755
--- a/git-sh-setup.sh
+++ b/git-sh-setup.sh
@@ -119,7 +119,7 @@ get_author_ident_from_commit () {
}
'
encoding=$(git config i18n.commitencoding || echo UTF-8)
- git show -s --pretty=raw --encoding="$encoding" "$1" |
+ git show -s --pretty=raw --encoding="$encoding" "$1" -- |
LANG=C LC_ALL=C sed -ne "$pick_author_script"
}
diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh
index e33ea4e9f..e5ed74545 100755
--- a/t/t3404-rebase-interactive.sh
+++ b/t/t3404-rebase-interactive.sh
@@ -340,4 +340,26 @@ test_expect_success 'rebase a commit violating pre-commit' '
'
+test_expect_success 'rebase with a file named HEAD in worktree' '
+
+ rm -fr .git/hooks &&
+ git reset --hard &&
+ git checkout -b branch3 A &&
+
+ (
+ GIT_AUTHOR_NAME="Squashed Away" &&
+ export GIT_AUTHOR_NAME &&
+ >HEAD &&
+ git add HEAD &&
+ git commit -m "Add head" &&
+ >BODY &&
+ git add BODY &&
+ git commit -m "Add body"
+ ) &&
+
+ FAKE_LINES="1 squash 2" git rebase -i to-be-rebased &&
+ test "$(git show -s --pretty=format:%an)" = "Squashed Away"
+
+'
+
test_done
diff --git a/t/t7502-status.sh b/t/t7502-status.sh
index 9ce50cade..b64ce30ff 100755
--- a/t/t7502-status.sh
+++ b/t/t7502-status.sh
@@ -17,6 +17,9 @@ test_expect_success 'setup' '
: > dir1/tracked &&
: > dir1/modified &&
git add . &&
+
+ git status >output &&
+
test_tick &&
git commit -m initial &&
: > untracked &&
@@ -28,6 +31,12 @@ test_expect_success 'setup' '
git add dir2/added
'
+test_expect_success 'status (1)' '
+
+ grep -e "use \"git rm --cached <file>\.\.\.\" to unstage" output
+
+'
+
cat > expect << \EOF
# On branch master
# Changes to be committed:
@@ -51,7 +60,7 @@ cat > expect << \EOF
# untracked
EOF
-test_expect_success 'status' '
+test_expect_success 'status (2)' '
git status > output &&
git diff expect output
diff --git a/upload-pack.c b/upload-pack.c
index 7e0431102..51e3ec49d 100644
--- a/upload-pack.c
+++ b/upload-pack.c
@@ -620,6 +620,9 @@ int main(int argc, char **argv)
if (i != argc-1)
usage(upload_pack_usage);
+
+ setup_path(NULL);
+
dir = argv[i];
if (!enter_repo(dir, strict))
diff --git a/wt-status.c b/wt-status.c
index f14022f2a..0b060934e 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -60,7 +60,7 @@ static void wt_status_print_cached_header(struct wt_status *s)
{
const char *c = color(WT_STATUS_HEADER);
color_fprintf_ln(s->fp, c, "# Changes to be committed:");
- if (s->reference) {
+ if (!s->is_initial) {
color_fprintf_ln(s->fp, c, "# (use \"git reset %s <file>...\" to unstage)", s->reference);
} else {
color_fprintf_ln(s->fp, c, "# (use \"git rm --cached <file>...\" to unstage)");