https://github.com/git/git
Revision 8ba105dda861d33f3d7c3b9989592c1605027116 authored by Junio C Hamano on 30 July 2012, 20:04:18 UTC, committed by Junio C Hamano on 30 July 2012, 20:04:18 UTC
When "git submodule add" clones a submodule repository, it can get
confused where to store the resulting submodule repository in the
superproject's .git/ directory when there is a symbolic link in the
path to the current directory.

* jl/maint-1.7.10-recurse-submodules-with-symlink:
  submodules: don't stumble over symbolic links when cloning recursively
2 parent s 80ffb75 + 6eafa6d
Raw File
Tip revision: 8ba105dda861d33f3d7c3b9989592c1605027116 authored by Junio C Hamano on 30 July 2012, 20:04:18 UTC
Merge branch 'jl/maint-1.7.10-recurse-submodules-with-symlink' into maint
Tip revision: 8ba105d
git-lost-found.sh
#!/bin/sh

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

echo "WARNING: '$0' is deprecated in favor of 'git fsck --lost-found'" >&2

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

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

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