]> gitweb.fluxo.info Git - utils-git.git/commitdiff
Support named paths at commit-updates
authorSilvio Rhatto <rhatto@riseup.net>
Thu, 18 Jun 2015 21:35:34 +0000 (18:35 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Thu, 18 Jun 2015 21:35:34 +0000 (18:35 -0300)
commit-updates

index 303bee0827f53b419123c2e85747f1f572e7627b..a6aa245da35a1093fc32cc0ea7c6c11743cf5512 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/bash
 #
-# Commit both on git and svn
+# Commit updates
 #
 
 # Parameters
@@ -9,14 +9,14 @@ ARGS="$*"
 # Simply update commit
 if git status &> /dev/null; then
   if [ ! -z "$1" ]; then
-    if [ -e '.git' ]; then
-      commit "Updates $*"
-    elif [ -d "$1" ]; then
-      ( cd $1 && commit "Updates $(basename $1)" )
-    fi
+    commit "Updates $*"
   else
     commit "Updates $(basename `pwd`)"
   fi
 else
-  mr commit -m "Updates"
+  if [ ! -z "$1" ] && [ -d "$1" ]; then
+    ( cd $1 &> /dev/null && commit "Updates $(basename $1)" )
+  else
+    mr commit -m "Updates"
+  fi
 fi