threads / patch / 543

patchStrip .git suffix from destination directory

Subject: [PATCH Cogito] Strip .git suffix from destination directory

## tl;dr

One message between May 9, 2005 and May 9, 2005. Diffs are folded; open one to read it.

replies: 0people: 1as markdown or json

Marcel Holtmann· May 9, 2005, 01:10 UTC · lore
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
Show changes to diff +2 −2
Index: cg-clone
===================================================================
--- 00b94eea5b99d5dd1d1bbe9c9ca3502d11aec581/cg-clone  (mode:100755)
+++ uncommitted/cg-clone  (mode:100755)
@@ -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

← back to recent threads