Staging
v0.5.1
https://github.com/git/git
Revision a3eb250f996bf5e12376ec88622c4ccaabf20ea8 authored by Junio C Hamano on 10 July 2005, 22:40:43 UTC, committed by Linus Torvalds on 10 July 2005, 23:16:34 UTC
The location alt_odb[j].name[0..] is filled with ??/?{38} to form a sha1
filename to try, but I was too lazy to allocate a copy, so while
fsck_object_dir() is running for the directory, the filenames ??/?{38}
are filled after NUL (usually and always the location should have '/'),
making them "not found".

This should fix it.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
1 parent cf21919
Raw File
Tip revision: a3eb250f996bf5e12376ec88622c4ccaabf20ea8 authored by Junio C Hamano on 10 July 2005, 22:40:43 UTC
[PATCH] alternate object store and fsck
Tip revision: a3eb250
git-checkout-script
#!/bin/sh
. git-sh-setup-script || die "Not a git archive"

old=$(git-rev-parse HEAD)
new=
force=
branch=
while [ "$#" != "0" ]; do
    arg="$1"
    shift
    case "$arg" in
	"-f")
		force=1
		;;
	*)
		rev=$(git-rev-parse --verify --revs-only "$arg")
		if [ -z "$rev" ]; then
			echo "unknown flag $arg"
			exit 1
		fi
		if [ "$new" ]; then
			echo "Multiple revisions?"
			exit 1
		fi
		new="$rev"
		if [ -f "$GIT_DIR/refs/heads/$arg" ]; then
			branch="$arg"
		fi
		;;
    esac
    i=$(($i+1))
done
[ -z "$new" ] && new=$old

if [ "$force" ]
then
    git-read-tree --reset $new &&
	git-checkout-cache -q -f -u -a
else
    git-read-tree -m -u $old $new
fi

# 
# Switch the HEAD pointer to the new branch if it we
# checked out a branch head, and remove any potential
# old MERGE_HEAD's (subsequent commits will clearly not
# be based on them, since we re-set the index)
#
if [ "$?" -eq 0 ]; then
	[ "$branch" ] && ln -sf "refs/heads/$branch" "$GIT_DIR/HEAD"
	rm -f "$GIT_DIR/MERGE_HEAD"
fi
back to top