Staging
v0.5.1
https://github.com/git/git
Revision e1a0c8b1483b38d32d3870408e03a6c1b340aa15 authored by Junio C Hamano on 02 March 2006, 01:06:12 UTC, committed by Junio C Hamano on 02 March 2006, 01:06:12 UTC
* lt/fix-apply:
  git-am: --whitespace=x option.
  git-apply: war on whitespace -- finishing touches.
  git-apply --whitespace=nowarn
  apply --whitespace: configuration option.
  apply: squelch excessive errors and --whitespace=error-all
  apply --whitespace fixes and enhancements.
  The war on trailing whitespace
2 parent s 9e7c73d + 12cbbdc
Raw File
Tip revision: e1a0c8b1483b38d32d3870408e03a6c1b340aa15 authored by Junio C Hamano on 02 March 2006, 01:06:12 UTC
Merge branch 'lt/fix-apply' into maint
Tip revision: e1a0c8b
git-lost-found.sh
#!/bin/sh

USAGE=''
SUBDIRECTORY_OK='Yes'
. git-sh-setup

if [ "$#" != "0" ]
then
    usage
fi

laf="$GIT_DIR/lost-found"
rm -fr "$laf" && mkdir -p "$laf/commit" "$laf/other" || exit

git fsck-objects |
while read dangling type sha1
do
	case "$dangling" in
	dangling)
		if git-rev-parse --verify "$sha1^0" >/dev/null 2>/dev/null
		then
			dir="$laf/commit"
			git-show-branch "$sha1"
		else
			dir="$laf/other"
		fi
		echo "$sha1" >"$dir/$sha1"
		;;
	esac
done
back to top