From 280ce56b89bb0bd0cc89141039565beff45e1e28 Mon Sep 17 00:00:00 2001
From: David Edmundson <davidedmundson@kde.org>
Date: Tue, 4 Feb 2014 16:20:05 +0100
Subject: [PATCH] Create .git/info directory if it does not exist before
 grafting

When cloning a new repository the directory .git/info does not
always exist. This change ensures this directory is always created
before trying to write to a file in that directory.

Change-Id: I9488caa7c4d0d80588ba880bee3bf9d8c11cca92
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
---
 bin/git-qt-grafts | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/bin/git-qt-grafts b/bin/git-qt-grafts
index 6fe38a1..6a8872b 100755
--- a/bin/git-qt-grafts
+++ b/bin/git-qt-grafts
@@ -99,8 +99,10 @@ while (<$GIT_REVLIST>) {
 close($GIT_REVLIST);
 
 my $found_any_grafts = 0;
+mkdir("$git_dir/info");
 my $graft_file = "$git_dir/info/grafts";
 my @graft_lines;
+
 foreach my $commit (@commits) {
     # find the graft point which the commit mentions
     my $commit_msg = `git show -s --format=%b $commit`;
-- 
GitLab