On Wed, Aug 19, 2015 at 12:08 PM, Junio C Hamano <[email protected]> wrote:
> Stefan Beller <[email protected]> writes:
>
>> `module_clone` is part of the update command, which I want to convert
>> to C next.
>>
>> Signed-off-by: Stefan Beller <[email protected]>
>> ---
>>
>> This is the only patch that broke by a last minute fix,
>> so this replaces the previous PATCH 7/7.
>
> ... which still breaks 7400.82, though.
because I messed up the resending. :(
Squashing in this fixes it:
---8<---
diff --git a/git-submodule.sh b/git-submodule.sh
index e50451b..e7d221e 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -338,7 +338,7 @@ Use -f if you really want to add it." >&2
echo "$(eval_gettext "Reactivating
local git directory for submodule '\$sm_name'.")"
fi
fi
- git submodule--helper module_clone --prefix
"$wt_prefix" --path "$sm_path" --name "$sm_name" --url "$realrepo"
--reference "$reference_path" --depth "$depth" || exit
+ git submodule--helper module_clone --prefix
"$wt_prefix" --path "$sm_path" --name "$sm_name" --url "$realrepo"
"$reference_path" "$depth" || exit
(
clear_local_git_env
cd "$sm_path" &&
@@ -634,7 +634,7 @@ cmd_update()
shift
;;
--depth=*)
- depth=$1
+ depth="$1"
;;
--)
shift
---
because both depth and reference are either empty string or containing
both key and value
(i.e. $depth will be "--depth=5" and we should not pass --depth into
submodule--helper module_clone
twice)
I can resend the patch as a whole if you'd like. I'd send it together
in the next series later today, which will demonstrate a possible
implementation of `git submodule foreach-parallel`
>
> Output from running it with "-i -v" ends like this:
>
> expecting success:
> mkdir super &&
> pwd=$(pwd) &&
> (
> cd super &&
> git init &&
> git submodule add --depth=1 file://"$pwd"/example2 submodule
> &&
> (
> cd submodule &&
> test 1 = $(git log --oneline | wc -l)
> )
> )
>
> Initialized empty Git repository in /home/gitster/w/git.git/t/trash
> directory.t7400-submodule-basic/super/.git/
> fatal: Clone of 'file:///home/gitster/w/git.git/t/trash
> directory.t7400-submodule-basic/example2' into submodule path 'submodule'
> failed
> not ok 82 - submodule add clone shallow submodule
> #
> # mkdir super &&
> # pwd=$(pwd) &&
> # (
> # cd super &&
> # git init &&
> # git submodule add --depth=1 file://"$pwd"/example2
> submodule &&
> # (
> # cd submodule &&
> # test 1 = $(git log --oneline | wc -l)
> # )
> # )
> #
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html