Fix minor coding style and cleanup local variables
This commit is contained in:
parent
575b919143
commit
2261a5e7af
1 changed files with 10 additions and 14 deletions
|
@ -144,7 +144,7 @@ gitception_remove()
|
||||||
|
|
||||||
gitception_new_repo()
|
gitception_new_repo()
|
||||||
{
|
{
|
||||||
local empty_tree=4b825dc642cb6eb9a060e54bf8d69288fbee4904
|
local commit_id= empty_tree=4b825dc642cb6eb9a060e54bf8d69288fbee4904
|
||||||
# get any file to update Gref, and if it's not updated we create empty
|
# get any file to update Gref, and if it's not updated we create empty
|
||||||
git update-ref -d "$Gref" || :
|
git update-ref -d "$Gref" || :
|
||||||
gitception_get "$1" "x" 2>/dev/null >&2 || :
|
gitception_get "$1" "x" 2>/dev/null >&2 || :
|
||||||
|
@ -321,19 +321,15 @@ safe_git_rev_parse()
|
||||||
|
|
||||||
make_new_repo()
|
make_new_repo()
|
||||||
{
|
{
|
||||||
local urlid_= fix_config=
|
|
||||||
echo_info "Setting up new repository"
|
echo_info "Setting up new repository"
|
||||||
PUTREPO "$URL"
|
PUTREPO "$URL"
|
||||||
|
|
||||||
# Needed assumption: the same user should have no duplicate Repoid
|
# Needed assumption: the same user should have no duplicate Repoid
|
||||||
Repoid=":id:$(genkey 15)"
|
Repoid=":id:$(genkey 15)"
|
||||||
iseq "${NAME#gcrypt::}" "$URL" || {
|
iseq "${NAME#gcrypt::}" "$URL" ||
|
||||||
git config "remote.$NAME.gcrypt-id" "$Repoid"
|
git config "remote.$NAME.gcrypt-id" "$Repoid"
|
||||||
fix_config=1
|
|
||||||
}
|
|
||||||
echo_info "Remote ID is $Repoid"
|
echo_info "Remote ID is $Repoid"
|
||||||
Extension_list=$(xecho "extn comment")
|
Extension_list=$(xecho "extn comment")
|
||||||
#isnull "$fix_config" || echo_info "(configuration for $NAME updated)"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -383,7 +379,8 @@ read_config()
|
||||||
|
|
||||||
if isnull "$Recipients"
|
if isnull "$Recipients"
|
||||||
then
|
then
|
||||||
echo_info "You have not configured any keys to encrypt to for this repository"
|
echo_info "You have not configured any keys you can encrypt to" \
|
||||||
|
"for this repository"
|
||||||
echo_info "Use ::"
|
echo_info "Use ::"
|
||||||
echo_info " git config gcrypt.participants YOURKEYID"
|
echo_info " git config gcrypt.participants YOURKEYID"
|
||||||
exit 1
|
exit 1
|
||||||
|
@ -448,9 +445,8 @@ ensure_connected()
|
||||||
fi
|
fi
|
||||||
|
|
||||||
Repoid=
|
Repoid=
|
||||||
isnull "$r_name" || {
|
isnull "$r_name" ||
|
||||||
Repoid=$(git config "remote.$r_name.gcrypt-id" || :)
|
Repoid=$(git config "remote.$r_name.gcrypt-id" || :)
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
TmpManifest_Enc="$Localdir/tmp_manifest.$$"
|
TmpManifest_Enc="$Localdir/tmp_manifest.$$"
|
||||||
|
@ -490,11 +486,10 @@ ensure_connected()
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
isnull "$r_name" || {
|
isnull "$r_name" || git config "remote.$r_name.gcrypt-id" "$rcv_repoid"
|
||||||
git config "remote.$r_name.gcrypt-id" "$rcv_repoid"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# $1 is the packline pack :SHA256:abc1231..
|
||||||
fetch_decrypt_pack()
|
fetch_decrypt_pack()
|
||||||
{
|
{
|
||||||
local key_= rcv_id= htype_= pack_= hfunc_=
|
local key_= rcv_id= htype_= pack_= hfunc_=
|
||||||
|
@ -654,8 +649,9 @@ do_push()
|
||||||
# Each git packfile is encrypted and then named for the encrypted
|
# Each git packfile is encrypted and then named for the encrypted
|
||||||
# file's hash. The manifest is updated with the pack id.
|
# file's hash. The manifest is updated with the pack id.
|
||||||
# The manifest is encrypted.
|
# The manifest is encrypted.
|
||||||
local rev_list= src_= dst_= line_= pack_id= key_= obj_= pack_delete=
|
local rev_list= src_= dst_= line_= pack_id= key_= obj_= \
|
||||||
del_hash=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
did_repack= pack_delete= \
|
||||||
|
del_hash=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||||
|
|
||||||
ensure_connected
|
ensure_connected
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue