Commit 5be60078 authored by Junio C Hamano's avatar Junio C Hamano

Rewrite "git-frotz" to "git frotz"

This uses the remove-dashes target to replace "git-frotz" to "git frotz".
Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
parent 36e5e70e
......@@ -10,7 +10,7 @@ USAGE='<refname> <target directory>'
export GIT_DIR
test -z "$mandir" && usage
if ! git-rev-parse --verify "$head^0" >/dev/null; then
if ! git rev-parse --verify "$head^0" >/dev/null; then
echo >&2 "head: $head does not exist in the current repository"
usage
fi
......@@ -18,12 +18,12 @@ fi
GIT_INDEX_FILE=`pwd`/.quick-doc.index
export GIT_INDEX_FILE
rm -f "$GIT_INDEX_FILE"
git-read-tree $head
git-checkout-index -a -f --prefix="$mandir"/
git read-tree $head
git checkout-index -a -f --prefix="$mandir"/
if test -n "$GZ"; then
cd "$mandir"
for i in `git-ls-tree -r --name-only $head`
for i in `git ls-tree -r --name-only $head`
do
gzip < $i > $i.gz && rm $i
done
......
......@@ -30,8 +30,8 @@ notbare|"")
esac
test "true" != "$pack_refs" ||
git-pack-refs --prune &&
git-reflog expire --all &&
git pack-refs --prune &&
git reflog expire --all &&
git-repack -a -d -l &&
$no_prune git-prune &&
git-rerere gc || exit
$no_prune git prune &&
git rerere gc || exit
......@@ -17,8 +17,8 @@ dropheads() {
"$GIT_DIR/LAST_MERGE" || exit 1
}
head=$(git-rev-parse --verify "$1"^0) &&
merge=$(git-rev-parse --verify "$2"^0) &&
head=$(git rev-parse --verify "$1"^0) &&
merge=$(git rev-parse --verify "$2"^0) &&
merge_name="$2" &&
merge_msg="$3" || usage
......@@ -34,7 +34,7 @@ dropheads
echo $head > "$GIT_DIR"/ORIG_HEAD
echo $merge > "$GIT_DIR"/LAST_MERGE
common=$(git-merge-base $head $merge)
common=$(git merge-base $head $merge)
if [ -z "$common" ]; then
die "Unable to find common commit between" $merge $head
fi
......@@ -46,11 +46,11 @@ case "$common" in
exit 0
;;
"$head")
echo "Updating $(git-rev-parse --short $head)..$(git-rev-parse --short $merge)"
git-read-tree -u -m $head $merge || exit 1
git-update-ref -m "resolve $merge_name: Fast forward" \
echo "Updating $(git rev-parse --short $head)..$(git rev-parse --short $merge)"
git read-tree -u -m $head $merge || exit 1
git update-ref -m "resolve $merge_name: Fast forward" \
HEAD "$merge" "$head"
git-diff-tree -p $head $merge | git-apply --stat
git diff-tree -p $head $merge | git apply --stat
dropheads
exit 0
;;
......@@ -62,7 +62,7 @@ git var GIT_COMMITTER_IDENT >/dev/null || exit
# Find an optimum merge base if there are more than one candidates.
LF='
'
common=$(git-merge-base -a $head $merge)
common=$(git merge-base -a $head $merge)
case "$common" in
?*"$LF"?*)
echo "Trying to find the optimum merge base."
......@@ -72,10 +72,10 @@ case "$common" in
for c in $common
do
rm -f $G
GIT_INDEX_FILE=$G git-read-tree -m $c $head $merge \
GIT_INDEX_FILE=$G git read-tree -m $c $head $merge \
2>/dev/null || continue
# Count the paths that are unmerged.
cnt=`GIT_INDEX_FILE=$G git-ls-files --unmerged | wc -l`
cnt=`GIT_INDEX_FILE=$G git ls-files --unmerged | wc -l`
if test $best_cnt -le 0 -o $cnt -le $best_cnt
then
best=$c
......@@ -92,9 +92,9 @@ case "$common" in
esac
echo "Trying to merge $merge into $head using $common."
git-update-index --refresh 2>/dev/null
git-read-tree -u -m $common $head $merge || exit 1
result_tree=$(git-write-tree 2> /dev/null)
git update-index --refresh 2>/dev/null
git read-tree -u -m $common $head $merge || exit 1
result_tree=$(git write-tree 2> /dev/null)
if [ $? -ne 0 ]; then
echo "Simple merge failed, trying Automatic merge"
git-merge-index -o git-merge-one-file -a
......@@ -102,11 +102,11 @@ if [ $? -ne 0 ]; then
echo $merge > "$GIT_DIR"/MERGE_HEAD
die "Automatic merge failed, fix up by hand"
fi
result_tree=$(git-write-tree) || exit 1
result_tree=$(git write-tree) || exit 1
fi
result_commit=$(echo "$merge_msg" | git-commit-tree $result_tree -p $head -p $merge)
result_commit=$(echo "$merge_msg" | git commit-tree $result_tree -p $head -p $merge)
echo "Committed merge $result_commit"
git-update-ref -m "resolve $merge_name: In-index merge" \
git update-ref -m "resolve $merge_name: In-index merge" \
HEAD "$result_commit" "$head"
git-diff-tree -p $head $result_commit | git-apply --stat
git diff-tree -p $head $result_commit | git apply --stat
dropheads
......@@ -26,8 +26,8 @@ if [ -d "$GIT_DIR"/remotes ]; then
mv "$GIT_DIR"/remotes "$GIT_DIR"/remotes.old
fi ;;
*)
echo "git-config $key "$value" $regex"
git-config $key "$value" $regex || error=1 ;;
echo "git config $key "$value" $regex"
git config $key "$value" $regex || error=1 ;;
esac
done
fi
......@@ -60,17 +60,17 @@ fall_back_3way () {
mkdir "$dotest/patch-merge-tmp-dir"
# First see if the patch records the index info that we can use.
git-apply -z --index-info "$dotest/patch" \
git apply -z --index-info "$dotest/patch" \
>"$dotest/patch-merge-index-info" &&
GIT_INDEX_FILE="$dotest/patch-merge-tmp-index" \
git-update-index -z --index-info <"$dotest/patch-merge-index-info" &&
git update-index -z --index-info <"$dotest/patch-merge-index-info" &&
GIT_INDEX_FILE="$dotest/patch-merge-tmp-index" \
git-write-tree >"$dotest/patch-merge-base+" ||
git write-tree >"$dotest/patch-merge-base+" ||
cannot_fallback "Repository lacks necessary blobs to fall back on 3-way merge."
echo Using index info to reconstruct a base tree...
if GIT_INDEX_FILE="$dotest/patch-merge-tmp-index" \
git-apply $binary --cached <"$dotest/patch"
git apply $binary --cached <"$dotest/patch"
then
mv "$dotest/patch-merge-base+" "$dotest/patch-merge-base"
mv "$dotest/patch-merge-tmp-index" "$dotest/patch-merge-index"
......@@ -80,7 +80,7 @@ It does not apply to blobs recorded in its index."
fi
test -f "$dotest/patch-merge-index" &&
his_tree=$(GIT_INDEX_FILE="$dotest/patch-merge-index" git-write-tree) &&
his_tree=$(GIT_INDEX_FILE="$dotest/patch-merge-index" git write-tree) &&
orig_tree=$(cat "$dotest/patch-merge-base") &&
rm -fr "$dotest"/patch-merge-* || exit 1
......@@ -97,7 +97,7 @@ It does not apply to blobs recorded in its index."
git-merge-recursive $orig_tree -- HEAD $his_tree || {
if test -d "$GIT_DIR/rr-cache"
then
git-rerere
git rerere
fi
echo Failed to merge in the changes.
exit 1
......@@ -198,7 +198,7 @@ else
# Start afresh.
mkdir -p "$dotest" || exit
git-mailsplit -d"$prec" -o"$dotest" -b -- "$@" > "$dotest/last" || {
git mailsplit -d"$prec" -o"$dotest" -b -- "$@" > "$dotest/last" || {
rm -fr "$dotest"
exit 1
}
......@@ -216,7 +216,7 @@ fi
case "$resolved" in
'')
files=$(git-diff-index --cached --name-only HEAD) || exit
files=$(git diff-index --cached --name-only HEAD) || exit
if [ "$files" ]; then
echo "Dirty index: cannot apply patches (dirty: $files)" >&2
exit 1
......@@ -254,7 +254,7 @@ if test "$skip" = t
then
if test -d "$GIT_DIR/rr-cache"
then
git-rerere clear
git rerere clear
fi
this=`expr "$this" + 1`
resume=
......@@ -287,14 +287,14 @@ do
# by the user, or the user can tell us to do so by --resolved flag.
case "$resume" in
'')
git-mailinfo $keep $utf8 "$dotest/msg" "$dotest/patch" \
git mailinfo $keep $utf8 "$dotest/msg" "$dotest/patch" \
<"$dotest/$msgnum" >"$dotest/info" ||
stop_here $this
test -s $dotest/patch || {
echo "Patch is empty. Was it split wrong?"
stop_here $this
}
git-stripspace < "$dotest/msg" > "$dotest/msg-clean"
git stripspace < "$dotest/msg" > "$dotest/msg-clean"
;;
esac
......@@ -347,7 +347,7 @@ do
case "$resolved$interactive" in
tt)
# This is used only for interactive view option.
git-diff-index -p --cached HEAD >"$dotest/patch"
git diff-index -p --cached HEAD >"$dotest/patch"
;;
esac
esac
......@@ -399,7 +399,7 @@ do
case "$resolved" in
'')
git-apply $git_apply_opt $binary --index "$dotest/patch"
git apply $git_apply_opt $binary --index "$dotest/patch"
apply_status=$?
;;
t)
......@@ -408,11 +408,11 @@ do
# trust what the user has in the index file and the
# working tree.
resolved=
git-diff-index --quiet --cached HEAD && {
git diff-index --quiet --cached HEAD && {
echo "No changes - did you forget to use 'git add'?"
stop_here_user_resolve $this
}
unmerged=$(git-ls-files -u)
unmerged=$(git ls-files -u)
if test -n "$unmerged"
then
echo "You still have unmerged paths in your index"
......@@ -433,7 +433,7 @@ do
then
# Applying the patch to an earlier tree and merging the
# result may have produced the same tree as ours.
git-diff-index --quiet --cached HEAD && {
git diff-index --quiet --cached HEAD && {
echo No changes -- Patch already applied.
go_next
continue
......@@ -453,12 +453,12 @@ do
"$GIT_DIR"/hooks/pre-applypatch || stop_here $this
fi
tree=$(git-write-tree) &&
tree=$(git write-tree) &&
echo Wrote tree $tree &&
parent=$(git-rev-parse --verify HEAD) &&
commit=$(git-commit-tree $tree -p $parent <"$dotest/final-commit") &&
parent=$(git rev-parse --verify HEAD) &&
commit=$(git commit-tree $tree -p $parent <"$dotest/final-commit") &&
echo Committed: $commit &&
git-update-ref -m "$GIT_REFLOG_ACTION: $SUBJECT" HEAD $commit $parent ||
git update-ref -m "$GIT_REFLOG_ACTION: $SUBJECT" HEAD $commit $parent ||
stop_here $this
if test -x "$GIT_DIR"/hooks/post-applypatch
......
......@@ -56,7 +56,7 @@ bisect_start() {
# Verify HEAD. If we were bisecting before this, reset to the
# top-of-line master first!
#
head=$(GIT_DIR="$GIT_DIR" git-symbolic-ref HEAD) ||
head=$(GIT_DIR="$GIT_DIR" git symbolic-ref HEAD) ||
die "Bad HEAD - I need a symbolic ref"
case "$head" in
refs/heads/bisect)
......@@ -99,7 +99,7 @@ bisect_start() {
break
;;
*)
rev=$(git-rev-parse --verify "$arg^{commit}" 2>/dev/null) || {
rev=$(git rev-parse --verify "$arg^{commit}" 2>/dev/null) || {
test $has_double_dash -eq 1 &&
die "'$arg' does not appear to be a valid revision"
break
......@@ -124,9 +124,9 @@ bisect_bad() {
bisect_autostart
case "$#" in
0)
rev=$(git-rev-parse --verify HEAD) ;;
rev=$(git rev-parse --verify HEAD) ;;
1)
rev=$(git-rev-parse --verify "$1^{commit}") ;;
rev=$(git rev-parse --verify "$1^{commit}") ;;
*)
usage ;;
esac || exit
......@@ -138,19 +138,19 @@ bisect_bad() {
bisect_write_bad() {
rev="$1"
echo "$rev" >"$GIT_DIR/refs/bisect/bad"
echo "# bad: "$(git-show-branch $rev) >>"$GIT_DIR/BISECT_LOG"
echo "# bad: "$(git show-branch $rev) >>"$GIT_DIR/BISECT_LOG"
}
bisect_good() {
bisect_autostart
case "$#" in
0) revs=$(git-rev-parse --verify HEAD) || exit ;;
*) revs=$(git-rev-parse --revs-only --no-flags "$@") &&
0) revs=$(git rev-parse --verify HEAD) || exit ;;
*) revs=$(git rev-parse --revs-only --no-flags "$@") &&
test '' != "$revs" || die "Bad rev input: $@" ;;
esac
for rev in $revs
do
rev=$(git-rev-parse --verify "$rev^{commit}") || exit
rev=$(git rev-parse --verify "$rev^{commit}") || exit
bisect_write_good "$rev"
echo "git-bisect good $rev" >>"$GIT_DIR/BISECT_LOG"
......@@ -161,7 +161,7 @@ bisect_good() {
bisect_write_good() {
rev="$1"
echo "$rev" >"$GIT_DIR/refs/bisect/good-$rev"
echo "# good: "$(git-show-branch $rev) >>"$GIT_DIR/BISECT_LOG"
echo "# good: "$(git show-branch $rev) >>"$GIT_DIR/BISECT_LOG"
}
bisect_next_check() {
......@@ -211,10 +211,10 @@ bisect_next() {
bisect_autostart
bisect_next_check good
bad=$(git-rev-parse --verify refs/bisect/bad) &&
bad=$(git rev-parse --verify refs/bisect/bad) &&
good=$(git for-each-ref --format='^%(objectname)' \
"refs/bisect/good-*" | tr '[\012]' ' ') &&
eval="git-rev-list --bisect-vars $good $bad --" &&
eval="git rev-list --bisect-vars $good $bad --" &&
eval="$eval $(cat "$GIT_DIR/BISECT_NAMES")" &&
eval=$(eval "$eval") &&
eval "$eval" || exit
......@@ -225,7 +225,7 @@ bisect_next() {
fi
if [ "$bisect_rev" = "$bad" ]; then
echo "$bisect_rev is first bad commit"
git-diff-tree --pretty $bisect_rev
git diff-tree --pretty $bisect_rev
exit 0
fi
......@@ -233,8 +233,8 @@ bisect_next() {
echo "$bisect_rev" >"$GIT_DIR/refs/heads/new-bisect"
git checkout -q new-bisect || exit
mv "$GIT_DIR/refs/heads/new-bisect" "$GIT_DIR/refs/heads/bisect" &&
GIT_DIR="$GIT_DIR" git-symbolic-ref HEAD refs/heads/bisect
git-show-branch "$bisect_rev"
GIT_DIR="$GIT_DIR" git symbolic-ref HEAD refs/heads/bisect
git show-branch "$bisect_rev"
}
bisect_visualize() {
......@@ -250,7 +250,7 @@ bisect_reset() {
else
branch=master
fi ;;
1) git-show-ref --verify --quiet -- "refs/heads/$1" || {
1) git show-ref --verify --quiet -- "refs/heads/$1" || {
echo >&2 "$1 does not seem to be a valid branch"
exit 1
}
......@@ -288,12 +288,12 @@ bisect_replay () {
;;
good)
echo "$rev" >"$GIT_DIR/refs/bisect/good-$rev"
echo "# good: "$(git-show-branch $rev) >>"$GIT_DIR/BISECT_LOG"
echo "# good: "$(git show-branch $rev) >>"$GIT_DIR/BISECT_LOG"
echo "git-bisect good $rev" >>"$GIT_DIR/BISECT_LOG"
;;
bad)
echo "$rev" >"$GIT_DIR/refs/bisect/bad"
echo "# bad: "$(git-show-branch $rev) >>"$GIT_DIR/BISECT_LOG"
echo "# bad: "$(git show-branch $rev) >>"$GIT_DIR/BISECT_LOG"
echo "git-bisect bad $rev" >>"$GIT_DIR/BISECT_LOG"
;;
*)
......
......@@ -6,8 +6,8 @@ SUBDIRECTORY_OK=Sometimes
require_work_tree
old_name=HEAD
old=$(git-rev-parse --verify $old_name 2>/dev/null)
oldbranch=$(git-symbolic-ref $old_name 2>/dev/null)
old=$(git rev-parse --verify $old_name 2>/dev/null)
oldbranch=$(git symbolic-ref $old_name 2>/dev/null)
new=
new_name=
force=
......@@ -29,9 +29,9 @@ while [ "$#" != "0" ]; do
shift
[ -z "$newbranch" ] &&
die "git checkout: -b needs a branch name"
git-show-ref --verify --quiet -- "refs/heads/$newbranch" &&
git show-ref --verify --quiet -- "refs/heads/$newbranch" &&
die "git checkout: branch $newbranch already exists"
git-check-ref-format "heads/$newbranch" ||
git check-ref-format "heads/$newbranch" ||
die "git checkout: we do not like '$newbranch' as a branch name."
;;
"-l")
......@@ -57,20 +57,20 @@ while [ "$#" != "0" ]; do
usage
;;
*)
if rev=$(git-rev-parse --verify "$arg^0" 2>/dev/null)
if rev=$(git rev-parse --verify "$arg^0" 2>/dev/null)
then
if [ -z "$rev" ]; then
echo "unknown flag $arg"
exit 1
fi
new_name="$arg"
if git-show-ref --verify --quiet -- "refs/heads/$arg"
if git show-ref --verify --quiet -- "refs/heads/$arg"
then
rev=$(git-rev-parse --verify "refs/heads/$arg^0")
rev=$(git rev-parse --verify "refs/heads/$arg^0")
branch="$arg"
fi
new="$rev"
elif rev=$(git-rev-parse --verify "$arg^{tree}" 2>/dev/null)
elif rev=$(git rev-parse --verify "$arg^{tree}" 2>/dev/null)
then
# checking out selected paths from a tree-ish.
new="$rev"
......@@ -129,14 +129,14 @@ Did you intend to checkout '$@' which can not be resolved as commit?"
# from a specific tree-ish; note that this is for
# rescuing paths and is never meant to remove what
# is not in the named tree-ish.
git-ls-tree --full-name -r "$new" "$@" |
git-update-index --index-info || exit $?
git ls-tree --full-name -r "$new" "$@" |
git update-index --index-info || exit $?
fi
# Make sure the request is about existing paths.
git-ls-files --error-unmatch -- "$@" >/dev/null || exit
git-ls-files -- "$@" |
git-checkout-index -f -u --stdin
git ls-files --error-unmatch -- "$@" >/dev/null || exit
git ls-files -- "$@" |
git checkout-index -f -u --stdin
exit $?
else
# Make sure we did not fall back on $arg^{tree} codepath
......@@ -144,7 +144,7 @@ else
# but switching branches.
if test '' != "$new"
then
git-rev-parse --verify "$new^{commit}" >/dev/null 2>&1 ||
git rev-parse --verify "$new^{commit}" >/dev/null 2>&1 ||
die "Cannot switch branch to a non-commit."
fi
fi
......@@ -200,10 +200,10 @@ fi
if [ "$force" ]
then
git-read-tree $v --reset -u $new
git read-tree $v --reset -u $new
else
git-update-index --refresh >/dev/null
merge_error=$(git-read-tree -m -u --exclude-per-directory=.gitignore $old $new 2>&1) || (
git update-index --refresh >/dev/null
merge_error=$(git read-tree -m -u --exclude-per-directory=.gitignore $old $new 2>&1) || (
case "$merge" in
'')
echo >&2 "$merge_error"
......@@ -254,12 +254,12 @@ fi
#
if [ "$?" -eq 0 ]; then
if [ "$newbranch" ]; then
git-branch $track $newbranch_log "$newbranch" "$new_name" || exit
git branch $track $newbranch_log "$newbranch" "$new_name" || exit
branch="$newbranch"
fi
if test -n "$branch"
then
GIT_DIR="$GIT_DIR" git-symbolic-ref -m "checkout: moving to $branch" HEAD "refs/heads/$branch"
GIT_DIR="$GIT_DIR" git symbolic-ref -m "checkout: moving to $branch" HEAD "refs/heads/$branch"
if test -n "$quiet"
then
true # nothing
......@@ -271,7 +271,7 @@ if [ "$?" -eq 0 ]; then
fi
elif test -n "$detached"
then
git-update-ref --no-deref -m "checkout: moving to $arg" HEAD "$detached" ||
git update-ref --no-deref -m "checkout: moving to $arg" HEAD "$detached" ||
die "Cannot detach HEAD"
if test -n "$detach_warn"
then
......
......@@ -20,7 +20,7 @@ require_work_tree
ignored=
ignoredonly=
cleandir=
disabled="`git-config --bool clean.requireForce`"
disabled="`git config --bool clean.requireForce`"
rmf="rm -f --"
rmrf="rm -rf --"
rm_refuse="echo Not removing"
......@@ -83,7 +83,7 @@ if [ -z "$ignored" ]; then
fi
fi
git-ls-files --others --directory $excl ${excl_info:+"$excl_info"} -- "$@" |
git ls-files --others --directory $excl ${excl_info:+"$excl_info"} -- "$@" |
while read -r file; do
if [ -d "$file" -a ! -L "$file" ]; then
if [ -z "$cleandir" ]; then
......
......@@ -43,7 +43,7 @@ clone_dumb_http () {
clone_tmp="$GIT_DIR/clone-tmp" &&
mkdir -p "$clone_tmp" || exit 1
if [ -n "$GIT_CURL_FTP_NO_EPSV" -o \
"`git-config --bool http.noEPSV`" = true ]; then
"`git config --bool http.noEPSV`" = true ]; then
curl_extra_args="${curl_extra_args} --disable-epsv"
fi
http_fetch "$1/info/refs" "$clone_tmp/refs" ||
......@@ -132,7 +132,7 @@ while
*/*)
die "'$2' is not suitable for an origin name"
esac
git-check-ref-format "heads/$2" ||
git check-ref-format "heads/$2" ||
die "'$2' is not suitable for a branch name"
test -z "$origin_override" ||
die "Do not give more than one --origin options."
......@@ -195,7 +195,7 @@ yes)
GIT_DIR="$D" ;;
*)
GIT_DIR="$D/.git" ;;
esac && export GIT_DIR && git-init $quiet ${template+"$template"} || usage
esac && export GIT_DIR && git init $quiet ${template+"$template"} || usage
if test -n "$reference"
then
......@@ -345,7 +345,7 @@ then
*)
continue ;;
esac
git-update-ref -m "clone: from $repo" "$destname" "$sha1" ""
git update-ref -m "clone: from $repo" "$destname" "$sha1" ""
done < "$GIT_DIR/CLONE_HEAD"
fi
......@@ -389,31 +389,31 @@ then
)
# Upstream URL
git-config remote."$origin".url "$repo" &&
git config remote."$origin".url "$repo" &&
# Set up the mappings to track the remote branches.
git-config remote."$origin".fetch \
git config remote."$origin".fetch \
"+refs/heads/*:$remote_top/*" '^$' &&
# Write out remote.$origin config, and update our "$head_points_at".
case "$head_points_at" in
?*)
# Local default branch
git-symbolic-ref HEAD "refs/heads/$head_points_at" &&
git symbolic-ref HEAD "refs/heads/$head_points_at" &&
# Tracking branch for the primary branch at the remote.
git-update-ref HEAD "$head_sha1" &&
git update-ref HEAD "$head_sha1" &&
rm -f "refs/remotes/$origin/HEAD"
git-symbolic-ref "refs/remotes/$origin/HEAD" \
git symbolic-ref "refs/remotes/$origin/HEAD" \
"refs/remotes/$origin/$head_points_at" &&
git-config branch."$head_points_at".remote "$origin" &&
git-config branch."$head_points_at".merge "refs/heads/$head_points_at"
git config branch."$head_points_at".remote "$origin" &&
git config branch."$head_points_at".merge "refs/heads/$head_points_at"
;;
'')
# Source had detached HEAD pointing nowhere
git-update-ref --no-deref HEAD "$head_sha1" &&
git update-ref --no-deref HEAD "$head_sha1" &&
rm -f "refs/remotes/$origin/HEAD"
;;
esac
......@@ -421,7 +421,7 @@ then
case "$no_checkout" in
'')
test "z$quiet" = z -a "z$no_progress" = z && v=-v || v=
git-read-tree -m -u $v HEAD HEAD
git read-tree -m -u $v HEAD HEAD
esac
fi
rm -f "$GIT_DIR/CLONE_HEAD" "$GIT_DIR/REMOTE_HEAD"
......
......@@ -8,7 +8,7 @@ SUBDIRECTORY_OK=Yes
. git-sh-setup
require_work_tree
git-rev-parse --verify HEAD >/dev/null 2>&1 || initial_commit=t
git rev-parse --verify HEAD >/dev/null 2>&1 || initial_commit=t
case "$0" in
*status)
......@@ -53,7 +53,7 @@ run_status () {
t) color= ;;
*) color=--nocolor ;;
esac
git-runstatus ${color} \
git runstatus ${color} \
${verbose:+--verbose} \
${amend:+--amend} \
${untracked_files:+--untracked}
......@@ -335,20 +335,20 @@ t,)
cd_to_toplevel &&
GIT_INDEX_FILE="$NEXT_INDEX" &&
export GIT_INDEX_FILE &&
git-diff-files --name-only -z |
git-update-index --remove -z --stdin
git diff-files --name-only -z |
git update-index --remove -z --stdin
) || exit
;;
,t)
save_index &&
git-ls-files --error-unmatch -- "$@" >/dev/null || exit
git ls-files --error-unmatch -- "$@" >/dev/null || exit
git-diff-files --name-only -z -- "$@" |
git diff-files --name-only -z -- "$@" |
(
cd_to_toplevel &&
GIT_INDEX_FILE="$NEXT_INDEX" &&
export GIT_INDEX_FILE &&
git-update-index --remove -z --stdin
git update-index --remove -z --stdin
) || exit
;;
,)
......@@ -364,28 +364,28 @@ t,)
refuse_partial "Cannot do a partial commit during a merge."
fi
TMP_INDEX="$GIT_DIR/tmp-index$$"
commit_only=`git-ls-files --error-unmatch -- "$@"` || exit
commit_only=`git ls-files --error-unmatch -- "$@"` || exit
# Build a temporary index and update the real index
# the same way.
if test -z "$initial_commit"
then
GIT_INDEX_FILE="$THIS_INDEX" \
git-read-tree --index-output="$TMP_INDEX" -i -m HEAD
git read-tree --index-output="$TMP_INDEX" -i -m HEAD
else
rm -f "$TMP_INDEX"
fi || exit
printf '%s\n' "$commit_only" |
GIT_INDEX_FILE="$TMP_INDEX" \
git-update-index --add --remove --stdin &&
git update-index --add --remove --stdin &&
save_index &&
printf '%s\n' "$commit_only" |
(
GIT_INDEX_FILE="$NEXT_INDEX"
export GIT_INDEX_FILE
git-update-index --remove --stdin
git update-index --remove --stdin
) || exit
;;
esac
......@@ -408,12 +408,12 @@ case "$status_only" in
t)
# This will silently fail in a read-only repository, which is
# what we want.
GIT_INDEX_FILE="$USE_INDEX" git-update-index -q --unmerged --refresh
GIT_INDEX_FILE="$USE_INDEX" git update-index -q --unmerged --refresh
run_status
exit $?
;;
'')