pathspec magic: add '^' as alias for '!'
[gitweb.git] / pathspec.c
index 7ababb315944d5536ec251b19937beef5def2538..ecad03406397338961fa0cb065b7ca18889d86ef 100644 (file)
@@ -224,6 +224,12 @@ static const char *parse_short_magic(unsigned *magic, const char *elem)
                char ch = *pos;
                int i;
 
+               /* Special case alias for '!' */
+               if (ch == '^') {
+                       *magic |= PATHSPEC_EXCLUDE;
+                       continue;
+               }
+
                if (!is_pathspec_magic(ch))
                        break;