Skip to content

Commit

Permalink
Merge branch 'maint'
Browse files Browse the repository at this point in the history
* maint:
  Documentation: cloning to empty directory is allowed
  Clarify kind of conflict in merge-one-file helper
  git config: clarify --add and --get-color
  archive-tar.c: squelch a type mismatch warning
  • Loading branch information
Junio C Hamano committed May 9, 2009
2 parents be427d7 + ec00d6e commit 6345d7a
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Documentation/git-clone.txt
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ then the cloned repository will become corrupt.
part of the source repository is used if no directory is
explicitly given ("repo" for "/path/to/repo.git" and "foo"
for "host.xz:foo/.git"). Cloning into an existing directory
is not allowed.
is only allowed if the directory is empty.

:git-clone: 1
include::urls.txt[]
Expand Down
5 changes: 3 additions & 2 deletions Documentation/git-config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ OPTIONS

--add::
Adds a new line to the option without altering any existing
values. This is the same as providing '^$' as the value_regex.
values. This is the same as providing '^$' as the value_regex
in `--replace-all`.

--get::
Get the value for a given key (optionally filtered by a regex
Expand Down Expand Up @@ -155,7 +156,7 @@ See also <<FILES>>.
When the color setting for `name` is undefined, the command uses
`color.ui` as fallback.

--get-color name default::
--get-color name [default]::

Find the color configured for `name` (e.g. `color.diff.new`) and
output it as the ANSI color escape sequence to the standard
Expand Down
2 changes: 1 addition & 1 deletion archive-tar.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ static int write_tar_entry(struct archiver_args *args,

sprintf(header.mode, "%07o", mode & 07777);
sprintf(header.size, "%011lo", S_ISREG(mode) ? size : 0);
sprintf(header.mtime, "%011lo", args->time);
sprintf(header.mtime, "%011lo", (unsigned long) args->time);

sprintf(header.uid, "%07o", 0);
sprintf(header.gid, "%07o", 0);
Expand Down
11 changes: 9 additions & 2 deletions git-merge-one-file.sh
Original file line number Diff line number Diff line change
Expand Up @@ -113,22 +113,29 @@ case "${1:-.}${2:-.}${3:-.}" in
src1=`git-unpack-file $2`
git merge-file "$src1" "$orig" "$src2"
ret=$?
msg=
if [ $ret -ne 0 ]; then
msg='content conflict'
fi

# Create the working tree file, using "our tree" version from the
# index, and then store the result of the merge.
git checkout-index -f --stage=2 -- "$4" && cat "$src1" >"$4"
rm -f -- "$orig" "$src1" "$src2"

if [ "$6" != "$7" ]; then
echo "ERROR: Permissions conflict: $5->$6,$7."
if [ -n "$msg" ]; then
msg="$msg, "
fi
msg="${msg}permissions conflict: $5->$6,$7"
ret=1
fi
if [ "$1" = '' ]; then
ret=1
fi

if [ $ret -ne 0 ]; then
echo "ERROR: Merge conflict in $4"
echo "ERROR: $msg in $4"
exit 1
fi
exec git update-index -- "$4"
Expand Down

0 comments on commit 6345d7a

Please sign in to comment.