Commits

Stefan Saasen committed 89825d4

Add 'unpack-refs' command to unpack all the refs into loose objects

  • Participants
  • Parent commits fe484e4

Comments (0)

Files changed (1)

bin/git-unpack-refs

+#!/bin/bash
+
+set -e
+set -u
+
+function unpack() {
+    export IFS=$'\n'
+    cd $(git rev-parse --git-dir)
+    for r in $(git show-ref); do
+        sha=$(echo $r | awk '{print $1}')
+        filename=$(echo $r | awk '{print $2}')
+        echo "sha: ${sha}, filename: ${filename}"
+        mkdir -p $(dirname $filename)
+        echo $sha > $filename
+    done
+}
+
+unpack