Skip to contentSkip to conversation

Strip .git suffix from destination directory

PATCH New Marcel Holtmann 1 participant 1 message Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Strip .git suffix from destination directory

Hi Petr,

the attached patch brings back the feature where a .git suffix got stripped from the directory name when cloning another tree.

It also fixes a $samedir vs. $same_dir spelling mistake.

Regards

Marcel

cg-clone: needs update
Index: cg-clone
===================================================================

cg-clone (mode:100755) +2 -2
@@ -28,10 +28,10 @@
 
 destdir=$2
 if [ "$destdir" ]; then
-	[ ! "$samedir" ] || die "specifying both -s and DESTDIR makes no sense"
+	[ ! "$same_dir" ] || die "specifying both -s and DESTDIR makes no sense"
 	dir=$destdir
 else
-	dir=${location%/.git}; dir=${dir##*/}
+	dir=${location%/.git}; dir=${dir##*/}; dir=${dir%.git}
 fi
 
 if ! echo "$location" | grep -q ":" ; then